For the nginx extended logs, I am using below grok pattern and KV pattern. But the value sometimes comes as '-' , some time real values and hypen + value.
How do i drop any field which has hypen ?
How do i sepearate the value if that contains - and values by dropping hypen ?
How i convert them to Integer or Number ?
If you use trim_value => "-, " it will remove the hyphens. You can use mutate+split to get an array from urt="0.001, 0.006". You can use mutate+convert to convert the fields to integer or float. To remove the empty fields you can use ruby
ruby {
code => '
event.get("kv_temp").each { |k, v|
if v == ""
event.remove("[kv_temp][#{k}]")
end
}
'
}
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.