Hi
I added additional information by fields option in filebeat configuration to identify application name, 'app_id', such as,
filebeat.inputs:
- type: log
enabled: true
fields:
app_id: crawler_164
......
output.logstash:
hosts: ["10.0.0.164:5044"]
And it can be found from the log of logstash such as,
......
"fields" => {
"app_id" => "crawler_164"
.......
Then how to use this parameter in the output of logstash to assemble special output value.
In my case, I use a http output,
output {
stdout { codec => rubydebug }
http {
url => "https://oapi.dingtalk.com/robot/send?access_token=......"
http_method => "post"
content_type => "application/json; charset=utf-8"
format => "message"
message => '{"msgtype":"text","text":{"content":"Alarm from %{app_id}:%{message}"}}'
}
}
%{message} can be parsed correctly and %{app_id} is not. So how to use this parameter?
Thank you!