LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Searching for values (https://www.linuxquestions.org/questions/programming-9/searching-for-values-924791/)

mikes88 01-20-2012 08:43 AM

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

grail 01-20-2012 09:21 AM

Sounds like a great challenge :) What have you done and where are you stuck?

mikes88 01-20-2012 09:36 AM

The thing is i have no idea where to start... im a complete noob at shell scripting.

grail 01-20-2012 12:02 PM

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

H_TeXMeX_H 01-20-2012 12:17 PM

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

David the H. 01-21-2012 07:13 AM

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.


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