SCRIPT to CAPTURE logs and save the output in a location
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
SCRIPT to CAPTURE logs and save the output in a location
Hi All,
I am a newbie,
I am looking for a script that can capture logs based on a request id and store it in tmp folder
Log files looks like this"
- 2015-07-08 10:59:17,100 INFO RequestId -> 923559008 Inside test method
- 2015-07-08 10:59:17,100 INFO RequestId -> 923559008 End of some test method method
- 2015-07-08 10:59:17,100 INFO RequestId -> 923559008 test test"
Trying to capture using Request id and request changes randomly, so it has to be a variable where i can set the value of the id and capture the logs in particular location.
Would really appreaciate your help
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150
Rep:
Please post what you have already tried and what the problems are, if you dont know where to start just google for BASH script examples/tutorials, there are hundreds out there, also grab a copy of the advanced bash scripting guide, it may be in your distros repos, dont panic it has basic stuff as well.
I am looking for a script that can capture logs based on a request id and store it in tmp folder
Log files looks like this"
Code:
- 2015-07-08 10:59:17,100 INFO RequestId -> 923559008 Inside test method
- 2015-07-08 10:59:17,100 INFO RequestId -> 923559008 End of some test method method
- 2015-07-08 10:59:17,100 INFO RequestId -> 923559008 test test"
Looks to me like it already being processed by (r)Syslog.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.