I have a data source with almost 692 fields, out of which only 200 fields are valid, i want to remove those fields , i tried using below one, but no luck
mutate { remove_field => [ ".value" ] }
all the unwanted fields are ending with ".value" filed , is there any way i can achieve this?
Few example fields FYI..
inc_active.value
inc_additional_assignee_list.value
inc_approval.value
inc_assigned_to.value
inc_close_notes.value
If they are top level fields you can use a prune filter with a wildcard in blacklist_names. If those examples are actually top-level objects that contain a value field then you will have to do it in ruby.
You need to explain exactly what you want to do. When you say inc_active.value, is inc_active a top level object that contains a field called value? If so, do you want to remove the value field or the inc_active object? Or is inc_active.value a top level field that has a period in its name?
@Badger I'm actually pulling data from servicenow this has duplicate fields like
inc_active.value : true
inc_active.display_value : true
inc_additional_assignee_list.value : windows
inc_additional_assignee_list.display_value : windows
inc_approval.value : 1
inc_approval.display_value : 1
inc_assigned_to.value : 0
inc_assigned_to.display_value : 0
inc_close_notes.value : NA
inc_close_notes.display_value : NA
From these documents i need to remove all fields which is ending with ".value", so that i my documents in elk will have only display_value fields
inc_active.display_value : true
inc_additional_assignee_list.display_value : windows
inc_approval.display_value : 1
inc_assigned_to.display_value : 0
inc_close_notes.display_value : NA
These are few fields, like this i have a total of 200 fields to be removed. Instead of adding all these 200 fields in prune blacklist, was checking if we can put a wildcard
Once again, is inc_approval.value a top level field, or is inc_approval an object that contains fields called value and display_value? If you do not understand the difference then add
output { stdout { codec => rubydebug } }
to your configuration and show us what the inc_approval fields look like.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.