I am using IIS module in filebeat to ship logs to my logstash. As, I have multiple environment and sites, i am trying to add custom field in iis.yml module to make my logstash work easy and create index based on enviroment. Below is my iis.yml file -
# Module: iis
# Docs: https://www.elastic.co/guide/en/beats/filebeat/7.6/filebeat-module-iis.html
- module: iis
# Access logs
access:
enabled: true
# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
var.paths: ["D:/Logs/W3SVC1/*.log"]
exclude_line: ['^.*ELB-HealthChecker.*$']
fields: {log_type: iisnonpro}
# Error logs
error:
enabled: false
# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
#var.paths:
But its not adding the custom field iisnonpro, while i output filebeat -
So in your case with iis module, the config should look like:
- module: iis
# Access logs
access:
enabled: true
# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
var.paths: ["D:/Logs/W3SVC1/*.log"]
exclude_line: ['^.*ELB-HealthChecker.*$']
input:
fields:
log_type: iisnonpro
# Error logs
error:
enabled: false
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.