Hi! I'd like to send a hostname and some other host metadata from filebeat to Logstash. Then Logstash saves files with a name like:
Summary
file {
path => "~/%{+YYYY-MM-dd}/%{component}/%{[@metadata][host]:[name]}-%{log_name}-%{+HH}.00.log.gz"
codec => line { format => "%{message}"}
file_mode => 0644
gzip => true }
But Logstash can't parse this path, it saves a file like: ~/2019-08-06/app/%{[@metadata][host]:[name]}-weblogic-14.00.log.gz
I've tried a lot of different combinations of {, @,[ and " . Where am I wrong? Part of my Filebeat configuration:
Summary
- type: log
enabled: true
paths:
- /var/log/weblogic/weblogic.log
fields:
component: app
env: test
log_name: weblogic
fields_under_root: true
processors:
- add_host_metadata:
cache.ttl: 5m
Also I tried - add_host_metadata: ~
What does tilde mean?
Of course, I can add a hostname in fields, but I'll have several paths and many servers so I don't want to enumerate each field in every path block.
Can anyone help, please!?
