Can you tell me about file archiving settings in Logstash?
I'm creating a pipeline configuration file as shown below.
With this configuration, no file (~.log) is output.
What could be the cause? Also, what should I check?
The owner of the output folder (/var/log/logstash-archive) is the "logstash" user.
Is this a problem?
No, that's fine if you run LS in the service mode. If you run as an process, then permission should have from that user which is started the LS command.
Is it possible to create such folders dynamically?
AFAIK, LS will not create a directory, only a file.
You have set correctly your syslog-pipeline.conf.
You should do:
Check LS logs /var/log/logstash, there should be a trace something like...TCP/UDP listener has been started on port 5140
Note: This input will start listeners on both TCP and UDP. That means when LS is started listening, you can use telnet on localhost to connect to port 5140 and send random characters. You will see the tag: _grokparsefailure
Add debug mode to see what's happening, it there any traffic coming to LS. Add in the output:
You'll know that syslog usually uses port 514, not port 5140. On the logstash server, you can make sure you are actually receiving data on port 5140, with tcpdump or similar tools. Or, as @Rios suggested, generate some traffic yourself, with telnet, or netcat, or bash even.
iptables and/or other firewalls may need to be disabled / re-configured.
Obviously, if the data is reaching elasticsearch's syslog-* indices then it is flowing, is that the case?
See my other response.
And a belated "Welcome to the forum!! @sysrq_1231 !!"
(and, in passing and just to check, you have 2 elasticsearch IPs listed. I hope that is 2 from N elasticsearch nodes in your cluster, where N>=3?)
In conclusion,
I confirmed that files and directories are created with the following settings.
I was also able to verify the data in Elasticsearch.
(It seems it takes time for the files and directories to be created,
and I apparently couldn't wait for that. My apologies!)
@RainTown
For this ELK Stack verification,
I am building the environment with the following configuration:
ã»Elasticsearch Master Node x 3
ã»Elasticsearch Data Node x 2
ã»Logstash x 2
ã»Kibana x 2
output {
elasticsearch {
hosts => ["http://192.168.1.xxx:9200", "http://192.168.1.yyy:9200"]
user => "elastic"
password => "<password>"
index => "syslog-%{+YYYY.MM.dd}"
}
In the above configuration, I specified the number of data nodes (please let me know if this is incorrect).
I checked the following site, but considering resilience,
would it be better to have three data nodes as well?
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.