I am trying to use the filebeat and ELK for the first time. I have my components running on RHEL5 server. Filebeat is running on another server with RHEL6 as OS and ELK is running in a 3rd server with RHEL6 as OS.
As suggested by many experts, i have mounted the logs folder from the RHEL5 machine to filebeat server. So now filebeat server can access the logs folder.
Following is the filebeat configuration file:
############################# Filebeat ######################################
filebeat:
# List of prospectors to fetch data.
prospectors:
# Each - is a prospector. Below are the prospector specific configurations
-
# Paths that should be crawled and fetched. Glob based paths.
# To fetch all ".log" files from a specific level of subdirectories
# /var/log/*/*.log can be used.
# For each file found under this path, a harvester is started.
# Make sure not file is defined twice as this can lead to unexpected behaviour.
paths:
- /mnt/cmdc_logs/*.audit
logstash:
# The Logstash hosts
hosts: ["10.209.26.151:5044"]
How can i verify that filebeat is sending all the logs from the mounted folder to logstash? Is there any logs? I dont see anything in Kibana. Once i resolve this, i can check why Kibana is not showing anything.
I am getting this error in the log.
2016-05-12T10:51:43Z CRIT Unable to publish events to console: write /dev/stdout: invalid argument
2016-05-12T10:51:43Z ERR Error sending/writing event: write /dev/stdout: invalid argument
Any idea why is this?
steffens,
The full config is as below for filebeat.
filebeat:
prospectors:
-
paths:
- /mnt/cmdc_logs/*.audit*"
input_type: log
document_type: my_log
output:
logstash:
hosts: ["10.209.26.147:5044"]
console:
pretty: true
shipper:
logging:
to_files: true
files:
path: /var/log/mybeat
# The name of the files where the logs are written to.
name: mybeat
# Configure log file size limit. If limit is reached, log file will be
# automatically rotated
rotateeverybytes: 10485760 # = 10MB
# Number of rotated log files to keep. Oldest files will be deleted first.
keepfiles: 7
#selectors: [ ]
level: info
Please find the output when i run. I dont see any errors here.
[root@astroHeka filebeat]# service filebeat start
Starting filebeat: 2016/05/18 07:49:18.047889 geolite.go:24: INFO GeoIP disabled: No paths were set under output.geoip.paths
2016/05/18 07:49:18.047934 outputs.go:126: INFO Activated console as output plugin.
2016/05/18 07:49:18.048154 logstash.go:106: INFO Max Retries set to: 3
2016/05/18 07:49:18.051179 outputs.go:126: INFO Activated logstash as output plugin.
2016/05/18 07:49:18.051793 publish.go:288: INFO Publisher name: astroHeka
2016/05/18 07:49:18.058809 async.go:78: INFO Flush Interval set to: 1s
2016/05/18 07:49:18.058832 async.go:84: INFO Max Bulk Size set to: 2048
2016/05/18 07:49:18.058931 async.go:78: INFO Flush Interval set to: 1s
2016/05/18 07:49:18.058947 async.go:84: INFO Max Bulk Size set to: 2048
2016/05/18 07:49:18.058998 beat.go:147: INFO Init Beat: filebeat; Version: 1.2.2
[ OK ]
The indentation looks weird. I can not tell if due to copy'n paste or indentation is off for real. beats use YAML format which is very sensitive to indentation.
This could be your problem. When running filebeat as service, stdout might be closed. Comment out output.console section in config file.
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.