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 {
|
if len(p.currentSettings.IncludedKeys) == 0 {
|
||||||
return true
|
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 {
|
for _, i := range p.currentSettings.IncludedKeys {
|
||||||
if i == key {
|
if i == key {
|
||||||
return true
|
return true
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,8 @@ data_format = "json_v2"
|
||||||
disable_prepend_keys = true
|
disable_prepend_keys = true
|
||||||
path = "@this"
|
path = "@this"
|
||||||
included_keys = [
|
included_keys = [
|
||||||
"hostname",
|
|
||||||
"systemVoltage",
|
"systemVoltage",
|
||||||
"systemCurrent",
|
"systemCurrent",
|
||||||
"tables",
|
"tables",
|
||||||
"tables_outputname",
|
|
||||||
]
|
]
|
||||||
tags = ["hostname", "tables_outputname"]
|
tags = ["hostname", "tables_outputname"]
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
[[inputs.file.json_v2.object]]
|
[[inputs.file.json_v2.object]]
|
||||||
path = "root.station"
|
path = "root.station"
|
||||||
disable_prepend_keys = true
|
disable_prepend_keys = true
|
||||||
included_keys = ["name", "etd_destination", "etd_estimate_minutes"]
|
included_keys = ["etd_estimate_minutes"]
|
||||||
tags = ["name", "etd_destination"]
|
tags = ["name", "etd_destination"]
|
||||||
[inputs.file.json_v2.object.fields]
|
[inputs.file.json_v2.object.fields]
|
||||||
etd_estimate_minutes = "int"
|
etd_estimate_minutes = "int"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue