Hi everyone!
I have logstash filter (grok) and I matched certain phrases as INT. When I open the mapping in kibana, I see that elasticsearch classified the INT as text. Why is that?
How do I change it? I want to make number based aggregations (like average), so I have to save these values as a number.
Log example: 13/11/2017 10:31:15:664 - [logReaderThread] WARN LogReader - Parser has a lag of [1984] seconds above a pre-defined threshold.
Hi, Thanks for the answer!
I did what you suggested (used mutate on the fields I want to convert from text to int), I tested the new logstash config (because I use mutate on many fields, not only "lag_sec") and the test was OK, I started kibana and refreshed the index, but when I check the mapping:
I solved it, and this is what I did for anyone who encounter the same thing:
The mutate filter didn't work, but we can make grok save a field not as string (as it does by default) just by adding :FORMAT after the semantic.
For example:
grok{
match => {"message" => "%{INT:someNum}"} ===> is a string
}
grok{
match => {"message" => "%{INT:someNum:int}"} ===> is a int
}
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.