LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 07-08-2015, 10:03 AM   #1
tsingh_5
LQ Newbie
 
Registered: Jul 2015
Posts: 1

Rep: Reputation: Disabled
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
 
Old 07-08-2015, 07:27 PM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
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.
 
Old 07-09-2015, 08:26 AM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by tsingh_5 View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing a shell script for logs movement to remote location. Satyaveer Arya Programming 12 04-08-2013 07:05 PM
[SOLVED] enabling shell script to capture the output of a command g4gupta Linux - General 2 03-11-2012 08:59 AM
bash script - capture serial output DEF. Programming 1 06-09-2009 10:07 AM
Is it possible to capture the output of a interactive script? Akhran Linux - Newbie 4 04-11-2007 09:28 PM
Bash script- capture cdparanoia text output code-breaker Linux - Software 7 08-03-2006 10:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration