LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-20-2012, 09:43 AM   #1
mikes88
Member
 
Registered: Jan 2012
Posts: 61

Rep: Reputation: Disabled
Searching for values


Hello all im back again with another question.

Trying to figure out how to write a script that will search through a log file for a peak rate for MONTH and YEAR to date.

Here are the basics...

There are about 18-20 servers.
there is a text file about 2GB in size with information from the entire year for peak rates. So theres a server name and value on each line.

so what i need to do is search through the file for each server for the entire year and pull out the peak rate and the same for the entire month.

If someone could help me that would be great.

Thanks
 
Old 01-20-2012, 10:21 AM   #2
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,655

Rep: Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967
Sounds like a great challenge What have you done and where are you stuck?
 
Old 01-20-2012, 10:36 AM   #3
mikes88
Member
 
Registered: Jan 2012
Posts: 61

Original Poster
Rep: Reputation: Disabled
The thing is i have no idea where to start... im a complete noob at shell scripting.
 
Old 01-20-2012, 01:02 PM   #4
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,655

Rep: Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967
Well I see you have already asked a question and received help so it must mean you are now needing to broaden your skills on what you have already learnt.
So in that case I can recommend the following sites to assist you:

http://tldp.org/LDP/abs/html/
http://mywiki.wooledge.org/TitleIndex
 
Old 01-20-2012, 01:17 PM   #5
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
I think awk may be what you need, but why not post a sample format for the log.

http://www.grymoire.com/Unix/Awk.html
 
Old 01-21-2012, 08:13 AM   #6
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950
Not to sound too critical here, but in case you haven't realized it yet, just posting vague descriptions about what you have and want usually means you're only going to get vague answers in return. You need to post detailed information and ask focused questions if you want detailed, useful replies.

It's also a good idea to demonstrate that you're making some effort to work out a solution on your own as well. Most of us prefer to provide guidance and help over rough spots rather than posting flat-out solutions.

Please read How To Ask Questions The Smart Way, and then tell us exactly what you want to do, what you've attempted so far, and where you're getting hung up.

At the very least post a sample of the input file, what you need to get out of it and in what format, and whatever non-working script-work you've tried already.

We'll be glad to help out if given the right context.
 
  


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
Searching for numeric values in PHP TheBeli Programming 5 04-17-2008 04:55 AM
Values like VARIABLE[i] ? BlueSpirit Programming 5 04-27-2007 02:35 PM
Testing values in C Machiaveli Programming 5 09-06-2006 02:26 PM
Threshold Values talat Linux - Software 1 08-26-2006 08:45 PM
rx/tx values Nauseous *BSD 1 05-26-2004 03:06 PM


All times are GMT -5. The time now is 05:12 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration