I have installed ELK on redhat machine. ELK version is 5.6.8. I searched a lot on google and discuss elastic forum as well but not able to solve it.
I have uploaded a screenshot of CPU usage.
I have already sent you the link of the logstash configuration file in the above question. How many events per second is it processing?
I have no idea how to check it.
The Logstash monitoring API should be able to report the event rate.
How big is mysqld.log? Were you processing it from scratch when you looked at the CPU usage? Was Logstash actually doing anything when the CPU usage was high?
Your grok expression is quite inefficient. You should reduce the amount of DATA and GREEDYDATA patterns you use.
No configuration file at all? So what about the config file you posted earlier? What configuration (if any) was in use when the CPU usage was high?
At least in the past running Logstash with no configuration files has resulted in restart loops, obviously resulting in high CPU usage since the JVM is constantly restarting.
Earlier we kept that conf file which I have sent you in /etc/logstash/conf.d directory but that time also CPU usage was high so for testing purpose we removed that .conf file and kept CPU idle.
I have done a setup on one more redhat server and kept below .conf file in /etc/logstash/conf.d directory but there is also CPU usage is high.
I am using below type of .conf file.
Have you tried using the hot threads API to get some clues about what Logstash is doing? Raising the loglevel to DEBUG and checking the Logstash log could also be useful.
I also tried to check whether logstash port is running or not
9300-9600 but none of the port is running.
Can you please tell me logstash default port?
I also checked logstash logs in debug mode and saw output that is quite obvious because I haven't kept any .conf file in /etc/logstash/conf.d directory.
logtsash log
[2018-08-22T11:23:32,852][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"6.2.4"}
[2018-08-22T11:23:32,889][INFO ][logstash.config.source.local.configpathloader] No config files found in path {:path=>"/etc/logstash/conf.d/*"}
[2018-08-22T11:23:32,890][ERROR][logstash.config.sourceloader] No configuration found in the configured sources.
[2018-08-22T11:23:32,944][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
As I said: At least in the past running Logstash with no configuration files has resulted in restart loops, obviously resulting in high CPU usage since the JVM is constantly restarting.
So, make sure you have configuration files in place before you attempt to do anything else.
As you said, I have kept at least one file in /etc/logstash/conf.d directory. Also, I have given all the permission to that user and file. Then restart the logstash service but I am getting some error like in the attached screenshot.
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.