Sponsored Content
Top Forums Shell Programming and Scripting perl script to filter logfile Post 27415 by norsk hedensk on Friday 30th of August 2002 04:21:38 PM
Old 08-30-2002
that would work but i want to only see the entries that pertain to files that exist on the server, what i want to do is filter out log file entries that contain paths to files that dont exist, actually now that i think about i i think that i could do what you suggested except i will exclude the error number 404 to see only succesful hits. thanks for you help! haha i know i would not have thought of that if you didnt suggest piping grep, thank you!
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to manipulate logfile text

Hi guys, I was wandering if a Shell guru could give me some advice on tackling a problem. I have used a mixture of grep, cut and awk to get data from a log file in the following format: 14/11/08 10:39: Checking currenly : Enabled 14/11/08 10:39: Records allocated : 221... (11 Replies)
Discussion started by: rosspaddock
11 Replies

2. Shell Programming and Scripting

Attaching a logfile to the Script

Hello guys. I've recently written a basic utilities script just for home use. and i want to attach a logfile to it that will record all the commands that where executed in that script. Then just so i can add the d%b%y% and make each logfile unique and i can look back in each logfile to see what i... (9 Replies)
Discussion started by: matt02
9 Replies

3. Shell Programming and Scripting

Logfile rotation script.

I'm trying to find or create a Perl script that: Checks for and creates these files: notes notes.1 notes.2 notes.3 notes.4 The first represents the current log file and the others are older versions. Each time the script runs it would check for the existence of notes.3 and, if it exists,... (3 Replies)
Discussion started by: HardyV2
3 Replies

4. Shell Programming and Scripting

Logfile monitor script

Hi, I'm trying to write a logfile monitor script that reads the logfile and then emails out once there is an error with SQL in. Here is my attempt below which does not work. I'm not much of a scripter as you can probably see but some pointers in the right direction would be much appreciated. ... (3 Replies)
Discussion started by: elmesy
3 Replies

5. Shell Programming and Scripting

Unable to create logfile with local time stamp using perl

Hello All, Morning, I am facing problem with my code while creating a log with name as current time stamp using perl. Here is the code. #!/usr/bin/perl my $time=localtime; my ($day,$month,$date,$tm,$year)=split(/ /,$time); my $stamp=$year."_".$month."_".$date; my... (4 Replies)
Discussion started by: krsnadasa
4 Replies

6. UNIX for Dummies Questions & Answers

perl filter unique and concatenate

Hi experts, I have some input like below, TEST A function W TEST A function X TEST B function Y TEST C function Z TEST C function ZY i would like to have below output, TEST A function W&X TEST B function Y TEST C function Z&ZY Please kindly help on this, i am cracking my head... (2 Replies)
Discussion started by: mingfatty
2 Replies

7. Shell Programming and Scripting

Perl script to filter the string

Hi folks, I have a log file with the lines in the below format. Jul 1 23:00:51 10.212.3.251 SS: %SYS-7-CLI_SCHEDULE: some error occured I want to split the line based on the " %SYS-7-CLI_SCHEDULE: " value. The criteria is the should store the word that starts with % i.e., ... (1 Reply)
Discussion started by: scriptscript
1 Replies

8. Shell Programming and Scripting

Logfile monitoring with logfile replacement

Bonjour, I've wrote a script to monitor a logfile in realtime. It is working almost perfeclty except for two things. The script use the following technique : tail -fn0 $logfile | \ while read line ; do ... some stuff done First one, I'd like a way to end the monitoring script if a... (3 Replies)
Discussion started by: Warluck
3 Replies
AMTOC(8)						  System Administration Commands						  AMTOC(8)

NAME
amtoc - generate TOC (Table Of Contents) for an Amanda run SYNOPSIS
amtoc [-a] [-i] [-t] [-f file] [-s subs] [-w] [--] logfile DESCRIPTION
Amtoc generates a table of contents for an Amanda run. It's a perl script (if you don't have perl, install it first!). OPTIONS
-a The output file name will be label-of-the-tape.toc in the same directory as logfile. -i Display help about amtoc. -t Generate the output in tabular form. -f file Write the output to a file ('-' for stdout). -s subs Evaluate the output file name from subs, with $_ set to label-of-the-tape. The -a option is equivalent to -s 's/$_/.toc/'. -w Separate tapes with form-feeds and display blank lines before totals. -- Marks the last option so the next parameter is the logfile. logfile (use '-' for stdin) OUTPUT FORMAT
The standard output has five fields separated by two spaces: # Server:/partition date level size[Kb] 0 daily-05: 19991005 - - 1 cuisun15:/cuisun15/home 19991005 1 96 2 cuinfs:/export/dentiste 19991005 1 96 ... 103 cuisg11:/ 19991005 0 4139136 103 total: - - 16716288 In tabular format (-t), this would look like: # Server:/partition date lev size[Kb] 0 daily-05: 19991005 - - 1 cuisun15:/cuisun15/home 19991005 1 96 2 cuinfs:/export/dentiste 19991005 1 96 ... 103 cuisg11:/ 19991005 0 4139136 103 total: - - 16716288 USAGE
The easiest way to use it is to run amtoc right after amdump in the cron job: amdump daily ; logdir=`amgetconf daily logdir` ; log=`ls -1t $logdir/log.*.[0-9] | head -1` ; amtoc -a $log which will generate /usr/local/etc/amanda//daily/tape_label.toc. You may also want to call amtoc after an amflush. SEE ALSO
amanda(8), amdump(8), amflush(8), amgetconf(8) The Amanda Wiki: : http://wiki.zmanda.com/ AUTHORS
Nicolas Mayencourt <Nicolas.Mayencourt@cui.unige.ch> University of Geneva/Switzerland Stefan G. Weichinger <sgw@amanda.org> Amanda 3.3.3 01/10/2013 AMTOC(8)
All times are GMT -4. The time now is 09:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy