Hi,
I'm processing quite large files using the json input codec. It's doing a great job of splitting up the data, creating fields and passing it to ES.
However... Some of the documents have a nested value a bit like this:
{ .... <stuff up here ... ,
"outer" : {
"inner_data_one" : val1,
"inner_data_two": val2,
"inner_data_three": val3
}
This, quite correctly results in logstash creating fields like:
"outer" => {
"inner_data_one" => val1,
"inner_data_two" => val2,
"inner_data_three" => val3
}
Which appear in ES as outer.inner_data_one and so on...
I need a way to delete SOME of those inner values... so far I see that I can do :
if [outer] {
mutate {
remove_field => ["[outer][inner_data_one]"]
}
This works and does remove the inner_data_one field which is great.. BUT... it is becoming quite laborious keeping the config up to date with potentially scores of inner data fields to be removed.
What I am looking for is a way to look up all the inner field names in a .txt file and if they are found there for them to be removed.
Is this possible?
Many thanks.
PS -- Re-reading this post I suppose what I might really be asking, which is simpler, is can remove_field work with an external file filled with values?