Skip to content

config with shadow results in indentation error #367

@jvrahav

Description

@jvrahav

Version

v1.67.0

Describe the bug

I have the following config

[FILTER]
name record_modifier
alias systemd_modifier
match system-bundle.systemd.*
whitelist_key _CMDLINE
whitelist_key _EXE
whitelist_key _HOSTNAME
whitelist_key _PID
whitelist_key MESSAGE
whitelist_key SYSLOG_IDENTIFIER
record filename systemd

To read this config, i use the following code

configData, err = ini.LoadSources(ini.LoadOptions{KeyValueDelimiters: " ", KeyValueDelimiterOnWrite: " ", AllowNonUniqueSections: true, InsensitiveKeys: true, AllowShadows: true, AllowNestedValues: true}, inputConfig)

With this, once the data is read, i write to a file. the output in file looks like. Please look at whitelist_key key

[FILTER]
name record_modifier
alias systemd_modifier
match system-bundle.systemd.*
whitelist_key _CMDLINE
whitelist_key _EXE
whitelist_key _HOSTNAME
whitelist_key _PID
whitelist_key MESSAGE
whitelist_key SYSLOG_IDENTIFIER
record filename systemd

To reproduce

configData, err = ini.LoadSources(ini.LoadOptions{KeyValueDelimiters: " ", KeyValueDelimiterOnWrite: " ", AllowNonUniqueSections: true, InsensitiveKeys: true, AllowShadows: true, AllowNestedValues: true}, inputConfig)

Expected behavior

expected to parse and write config in the format

[FILTER]
name record_modifier
alias systemd_modifier
match system-bundle.systemd.*
whitelist_key _CMDLINE
whitelist_key _EXE
whitelist_key _HOSTNAME
whitelist_key _PID
whitelist_key MESSAGE
whitelist_key SYSLOG_IDENTIFIER
record filename systemd

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions