Sponsored Content
Top Forums Shell Programming and Scripting Help parsing logs maybe with menu and variables? Post 302354194 by taekwondo on Thursday 17th of September 2009 02:25:49 PM
Old 09-17-2009
Help parsing logs maybe with menu and variables?

I would like to parse through some logs looking for things like exception or failed (grep -i failed). Ideal would be if it were in a menu format so someone without unix ability could just choose option 1 2 or 3 etc. If I could pass the hostname to a variable also that would be awesome, so someone could input the hostname and the script would know for hostname 'name' do the following stuff, look through the logs and find exceptions? I appreciate anyone's help, I'm not very good at scripts. Thanks.

this is some info on the server pwd. Oh, since there are so many logs, it would be nice if it could do it by day, maybe pass the date to a variable or something like that so someone could search by date?

Code:
archive]$ pwd
/home/username/current_release/logs/archive
 archive]$ ls -al

dassimulator.eif.2009_245_155007.381.log   demo-sdif.ops.2009_252_190302.853.log
demo-dsdm.ops.2009_260_123941.256.log      demo-snif.ops.2009_260_135053.210.log
demo-HMD-sdif.ops.2009_260_133644.200.log  demo-sve.ops.2009_260_135208.928.log
demo-sam.ops.2009_259_231215.066.log


---------- Post updated at 02:25 PM ---------- Previous update was at 11:32 AM ----------

Also, if you write a script and do this:

Quote:
cd /home/henry
pwd
ls -al *.log>/home/henry/logfiles
cat /home/henry/logfiles |awk '{print $9}
Output is a filename
If I want to take that filename and pass it to grep -i failure
so I can see which files had failures? How can I do that?
I tried |grep -i failure but it didn't work, also < grep -i failure didn't work.
~

Last edited by Neo; 09-21-2009 at 03:53 PM.. Reason: please use code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to pass variables to 3rd party unix menu?

Hello, I was wondering if it is possible to pass data to a unix driven 3rd party menu. Changing the code is out of the question. I have a menu with various options and I would like a ksh to execute the menu and input the required fields. For example. Main menu 1. Company Name 2. blah... (3 Replies)
Discussion started by: ctcuser
3 Replies

2. Shell Programming and Scripting

Parsing and getting values of variables

suppose i have a file value where it returns 3 values a=1 b=2 c=4 when i run it. i am using this file in my shell script. how do i parse and get the value of a b and c? (3 Replies)
Discussion started by: Rekha
3 Replies

3. UNIX for Dummies Questions & Answers

Parsing Powerbroker Logs for SysAdmin Changes (SOX)

I need to identify a list of AIX command strings that can be used to parse Powerbroker logs for changes that are being made by Unix SysAdmins. Need to filter out (as much as possible) inquiry or routine maintenance activity and concentrate on software/security changes. This is for internal... (1 Reply)
Discussion started by: bcouchtx
1 Replies

4. Shell Programming and Scripting

Parsing out the logs and generating report

My file will contain following(log.txt): start testcase: config loading ...... error XXXX ..... end testcase: config loading, result failed start testcase: ping check ..... error ZZZZZ ..... error AAAAA end testcase: Ping check, result failed I am expecting below output. ... (4 Replies)
Discussion started by: shellscripter
4 Replies

5. Shell Programming and Scripting

Parsing log files, displaying logs between specific dates

Sorry, couldn't really think of a simple subject/title. So, I have a log file, and the dates are displayed like so: 2009-03-05 02:49:44 So the first and second field are the date/time. I can change them into a unix timestamp easily with: date -d "2009-03-05 02:49:44" +%s However,... (17 Replies)
Discussion started by: Rhije
17 Replies

6. Shell Programming and Scripting

help using read in menu script to cat out lines in logs

What is wrong with my menu script? Do I need to continue with the read statements? All I want to do with option 4 is to cat some /var/log/files and awk out a few lines? How do I do that please? $ cat menu.sh ... (11 Replies)
Discussion started by: taekwondo
11 Replies

7. UNIX and Linux Applications

Parsing Tuxedo Logs

Right now I am parsing Tuxedo logs to calculate response times for various services. I was hoping to find a log tool that had support for Tuxedo and would generate drill down html reports. ---------- Post updated at 02:35 PM ---------- Previous update was at 02:33 PM ---------- I just wanted... (0 Replies)
Discussion started by: Lurch
0 Replies

8. Shell Programming and Scripting

Assigning values to reference variables for a dynamic menu driven script.

How do I assign values to reference variables? I am assigning a variable name to --> $user_var Then I am trying to change its underlying variable value by $((user_var))=$user_value .. its failing,, Please let me know if there is a way to do this dynamically.. FileA.props... (5 Replies)
Discussion started by: kchinnam
5 Replies

9. UNIX for Dummies Questions & Answers

Parsing alphanumeric variables

Hi All, I have files with a column which has values and ranges, for example colA colB ERD1 3456 ERD2 ERD3 4456 I want to have the following output colA colB colC ERD1 3456 3456 ERD2 526887 526890 ERD3 4456 4456 Being a newbie to... (2 Replies)
Discussion started by: alpesh
2 Replies

10. Shell Programming and Scripting

Parsing fields into variables

A record contains 50 fields separated by "~". I need to assign each of these fields to different variables. Following is the shell script approach I tried. RECORD="FIELD1~FIELD2~FIELD3~FIELD4~FIELD5~...........~FIELD50" VAR1=$(echo ${RECORD} | cut -d"~" -f 1) VAR2=$(echo ${RECORD} | cut... (5 Replies)
Discussion started by: krishmaths
5 Replies
ROUNDUP-SERVER(1)					      General Commands Manual						 ROUNDUP-SERVER(1)

NAME
roundup-demo - create a roundup "demo" tracker and launch its web interface SYNOPSIS
roundup-demo [backend [nuke]] OPTIONS
nuke Create a fresh demo tracker (deleting the existing one if any). If the additional backend argument is specified, the new demo tracker will use the backend named (one of "anydbm", "sqlite", "metakit", "mysql" or "postgresql"; subject to availability on your system). DESCRIPTION
This command creates a fresh demo tracker for you to experiment with. The email features of Roundup will be turned off (so the nosy feature won't send email). It does this by removing the nosyreaction.py module from the demo tracker's detectors directory. If you wish, you may modify the demo tracker by editing its configuration files and HTML templates. See the customisation manual for infor- mation about how to do that. Once you've fiddled with the demo tracker, you may use it as a template for creating your real, live tracker. Simply run the roundup-admin command to install the tracker from inside the demo tracker home directory, and it will be listed as an available template for installa- tion. No data will be copied over. AUTHOR
This manpage was written by Richard Jones <richard@users.sourceforge.net>. 27 July 2004 ROUNDUP-SERVER(1)
All times are GMT -4. The time now is 11:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy