LinuxQuestions.org
Register a domain and help support LQ
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, 11: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, 08:27 PM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Linux From Scratch, Slackware64, Partedmagic
Posts: 2,255

Rep: Reputation: 559Reputation: 559Reputation: 559Reputation: 559Reputation: 559Reputation: 559
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, 09:26 AM   #3
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,190
Blog Entries: 10

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 08:05 PM
[SOLVED] enabling shell script to capture the output of a command g4gupta Linux - General 2 03-11-2012 09:59 AM
bash script - capture serial output DEF. Programming 1 06-09-2009 11:07 AM
Is it possible to capture the output of a interactive script? Akhran Linux - Newbie 4 04-11-2007 10:28 PM
Bash script- capture cdparanoia text output code-breaker Linux - Software 7 08-03-2006 11:13 PM


All times are GMT -5. The time now is 07:21 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration