I'm shipping logs from windows servers using filebeat. I have created a field which shows the reponse time in milliseconds.
I have created a field "Create_Indexing_response_time_ms" using grok and it works perfectly when I run logstash and the field is getting created in ES
However when I give the less than condition and mutate to create another field, I get the below error (pasted in the next reply)
input {
beats {
port => 5044
}
}
filter
{
if [fields][logtype] == "Seal_Async_Logs"
{
grok {
match => { "message" => ".*\[TIME]Indexing took: %{NUMBER:Create_Indexing_response_time_ms:int}"}
}
}
if [fields][logtype] == "Seal_Async_Logs" and [Create_Indexing_response_time_ms] < 2000 {
mutate { add_field => { "Indexing_Time_taken" => "less than 2 seconds"}}
}
output {
elasticsearch {
hosts => ["http://10.150.59.17:9200"]
index => "filebeat.test-%{+YYYY.MM}"
}
}
Thanks @Badger but I already have the field created and the type reflects as "Number" so ideally logstash should not throw the exception when trying for a greater than expression.
Am I doing anything wrong ? Is it because I converted the type to integer using Grok instead of Mutate ? kindly help
Thanks @Badger I find its weird that Im getting the field in elasticsearch what I have defined in grok pattern and was able to get the expected results using KQL however Im not able to proceed with that field for any further actions in logstash due to _grokparsefailure tag
this is how the field and message appears in each document
I changed the pattern without space and tried refreshing the index pattern
Again, the field appears with the expected value however I still get the _grokparsefailre in the tag and due to this, im unable to use a mutate function using the same field
I have placed the conf file in pipelines.yml file and run logstash as a service
below is how the conf is placed in pipelines.yml
# Available options:
#
# # name of the pipeline
- pipeline.id: SEALlogs
path.config: "/ELK/logstash-oss-7.10.2-windows-x86_64/logstash-7.10.2/conf.d/test.conf"
OK, so you have configured a pipeline called SEALlogs and are getting the error for a pipeline called main. You are not running the configuration you think you are.
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.