I have logs in which there are different types of lines are present. And I want to write grok filter for each line. How I can I achieve it? My logs are as given below:
Oct 5 14:05:53 centos-8gb-nbg1-1 openvpn: Tue Oct 5 14:05:53 2021 TCP connection established with [AF_INET6]::ffff:192.168.10.1:55630
Oct 5 14:05:54 centos-8gb-nbg1-1 openvpn: Tue Oct 5 14:05:54 2021 192.168.10.1:55630 peer info: IV_GUI_VER=windows.NT.x86_64
Oct 5 14:05:54 centos-8gb-nbg1-1 openvpn: Tue Oct 5 14:05:54 2021 192.168.10.1:55630 peer info: IV_PLAT_VER=30_11_arm64-v8a_samsung_exynos9610_SM-A505F
Oct 5 14:31:44 centos-8gb-nbg1-1 openvpn: Tue Oct 5 14:01:44 2021 google/192.168.10.1:55418 Connection reset, restarting [0]
Please guide me how can I write grok filter for these lines.
Hi @AquaX , Thanks for your response.
I am beginner in ELK. So could you guide me how can write different grok patterns in logstash.conf for each line?
If the lines start with the SYSLOGTIMESTAMP then I strongly recommend that you anchor your patterns to the start of line: "^%{SYSLOGTIMESTAMP:time} ...". This makes it much cheaper to evaluate them when they do not match, and if you need an array of patterns there will always be some that do not match.
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.