tags no longer required in included_keys (#9406)
This commit is contained in:
parent
ac9bf5a0ec
commit
8638a41724
|
|
@ -484,6 +484,8 @@ func (p *Parser) isIncluded(key string, val gjson.Result) bool {
|
|||
if len(p.currentSettings.IncludedKeys) == 0 {
|
||||
return true
|
||||
}
|
||||
// automatically adds tags to included_keys so it does NOT have to be repeated in the config
|
||||
p.currentSettings.IncludedKeys = append(p.currentSettings.IncludedKeys, p.currentSettings.Tags...)
|
||||
for _, i := range p.currentSettings.IncludedKeys {
|
||||
if i == key {
|
||||
return true
|
||||
|
|
|
|||
|
|
@ -9,10 +9,8 @@ data_format = "json_v2"
|
|||
disable_prepend_keys = true
|
||||
path = "@this"
|
||||
included_keys = [
|
||||
"hostname",
|
||||
"systemVoltage",
|
||||
"systemCurrent",
|
||||
"tables",
|
||||
"tables_outputname",
|
||||
]
|
||||
tags = ["hostname", "tables_outputname"]
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
[[inputs.file.json_v2.object]]
|
||||
path = "root.station"
|
||||
disable_prepend_keys = true
|
||||
included_keys = ["name", "etd_destination", "etd_estimate_minutes"]
|
||||
included_keys = ["etd_estimate_minutes"]
|
||||
tags = ["name", "etd_destination"]
|
||||
[inputs.file.json_v2.object.fields]
|
||||
etd_estimate_minutes = "int"
|
||||
|
|
|
|||
Loading…
Reference in New Issue