'Hi All,
I'm trying to change the logstash.config file according to a log file. The log file consists three different types of log records which generated through my java application.
logstash.config file is as follows:
logstash configuration
input {
beats {
port => 5044
}
}
filter {
if[fields][messagetype] == "customer_request"{
grok{
match =>{
"message" => [ "%{WORD:apptime}::%{WORD:messagetype}::%{WORD:correlationId}::%{WORD:user_id}::%{WORD:user_gender}::%{WORD:user_type}::%{WORD:message}" ]
}
}
mutate{
add_field => [ "index_key" => "customer-request" ]
}
}
}
output {
stdout {
codec => rubydebug
}
elasticsearch {
index => "%{[index_key]}-%{+YYYY.MM.dd}"
hosts => ["localhost:9200"]
}
}
But the issue is index_key related value is not assigning which I added in add_filed in mutate section. It shows as %{[index_key]}-2020-08-10. I'm new to ELK stack and if anyone can help me, that would be a great.
Thanks...!
'
