Hi i have a switch log file log file which shows 3 parts. i am only interested in the third part
but the problem the lines are duplicated i am interested to show only the server name XXXX-XX-X
and the Status : Copy complete. here's the log:
`copy startup-config sftp://mfservice@10.240.151.155/home/mfservice/conf_XXXX-XXX-X-2018-01-08-06.00.16.txt
`
Connected to 10.240.151.155
sftp>
sftp> put /var/tmp/vsh/XXXX-XXX-X-startup-config /home/mfservice/conf_XXXX-XXX-X-2018-01-08-06.00.16.txt
Uploading /var/tmp/vsh/XXXX-XXX-X-startup-config to /home/mfservice/conf_XXXX-XXX-X_2018-01-08-06.00.16.txt
sftp> exit
Copy complete.
`copy startup-config sftp://mfservice@10.240.151.155/home/mfservice/conf_XXXX-XXX-X_2018-01-09-06.00.15.txt
`
Connected to 10.240.151.155.
sftp>
sftp> put /var/tmp/vsh/XXXX-XXX-X-startup-config /home/mfservice/conf_XXXX-XXX-X-2018-01-09-06.00.15.txt
Uploading /var/tmp/vsh/XXXX-XXX-X-startup-config to /home/mfservice/conf_XXXX-XXX-X-2018-01-09-06.00.15.txt
sftp> exit
Copy complete.
`copy startup-config sftp://mfservice@10.240.151.155/home/mfservice/dir_XXXX-XXX-X/conf_XXXX-XXX-X-2018-01-10-06.00.16.txt
`
Connected to 10.240.151.155.
sftp>
sftp> put /var/tmp/vsh/XXXX_XXX_X-startup-config /home/mfservice/dir_XXX-XXX-X/conf_XXXX_XXX_X_2018-01-10-06.00.16.txt
Uploading /var/tmp/vsh/XXXX_XXX_X-startup-config to /home/mfservice/dir_XXXX-XXX-X/conf_XXXX_XXX_X_2018-01-10-06.00.16.txt
sftp> exit
Copy complete.
when i apply my grok i get 3 results of the pattern i only need one result, i am only interested in the part where the date in the txt file is 2018-01-10. any help please.
The above looks like command line access. Can you share the make and model of the switch, logging coming out of the switch and your logstash config file? (input, filter, output).
well i didn't want to complicate thing i just wanted to know how to detect the last occurance of a word in the log file so i can apply my grok filter because i am only interested in the third part of the file.
here's my log file that i need to parse:
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.