I'm getting some fields in the kibana like "attributes.host_mem_file_buffer 1.3747773440e+09|g".
I want to first replace with "|g" to "" and then convert to float value.
I tried below one but it's not replacing "|g" to ""(empty)
mutate {
lowercase => [ "host" ]
gsub => [ "attributes.host_mem_mem_free", "|g", "" ]
gsub => [ "host_mem_mem_free", "|g", "" ]
gsub => [ "host.mem.mem.free", "|g", "" ]
}
Can you please help me how to remove "|g" in the string
Thanks for your reply but not working. Below is my code. Can you please suggest me how to change entire attribute object "|g"
mutate {
lowercase => [ "host" ] #gsub => [ "m_host_mem_mem_free", "|g", "" ]
gsub => [ "m_host_mem_mem_free", "|g", "" ]
}
I have another question related to same . I have 100 filed names values like "|g" and field names come like below
"attributes": {
"m_host_mem_mem_cache": "2.0229201920e+09|g",
"m_host_mem_mem_free": "3.8571212800e+09|g",
"m_host_mem_free_mem_swap": "1.9327344640e+10|g",
"m_host_mem_file_buffer": "8.2237849600e+08|g",
"m_host_mem_mem_total": "8.0994344960e+09|g",
"m_host_mem_mem_swap": "1.9327344640e+10|g"
},
How can I use iterator and dynamic replacement "|g" with empty and convert the float. Please give me solution.
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.