Sponsored Content
Full Discussion: filter errors in log
Top Forums UNIX for Advanced & Expert Users filter errors in log Post 302253190 by nobo on Friday 31st of October 2008 06:34:02 AM
Old 10-31-2008
Yes, many.

Here is something I use to give me summaries of iptables action by port #:

Code:
[root@gna ~]# cat bin/portActivity
#! /bin/bash
LOGFILE='/var/log/messages'
[ -n "$1" ] && LOGFILE=$1
egrep 'iptables' $LOGFILE | egrep -v 'PROTO=2' | sed 's/DF//' | awk '{ print $22}' \
| cut -b '5-' | sort -n | uniq -c | awk '{ print "port " $2 " had " $1 " hits" }'
[root@gna ~]# portActivity | head
port 21 had 15 hits
port 22 had 36 hits
port 23 had 20 hits
port 52 had 2 hits
port 53 had 1 hits
port 57 had 3 hits
port 60 had 2 hits
port 80 had 9 hits
port 110 had 1 hits
port 111 had 1 hits
[root@gna ~]#

YMWV depending on how your firewall logs stuff.

Learn the toolbox!

nobo
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep a log file to filter previous dates

Hi, I have problem of filtering a log file from my perl script. #cat /data/pinpe.csv_20070731 | nawk -v FS=, '{print $1','$18','$22','$26}' | grep -w 100 | grep -w 1 | nawk '{print $4}' Below is the output: 2009-06-16 2009-01-29 2009-06-02 2008-03-05 2007-08-05 2007-09-24... (5 Replies)
Discussion started by: pinpe
5 Replies

2. Shell Programming and Scripting

redirect errors to log file

I am working on a generic script that will run a shell script with the arguments passed and redirect errors to one file, and all other output to another file. Then if there is anything in the error file it emails the error to me, otherwise it exits. The advantage for this approach is that I... (0 Replies)
Discussion started by: gandolf989
0 Replies

3. Shell Programming and Scripting

To filter a log file

Hi All, I have a log File and i have to make a report in desired format.can anybody help me......... log file ------ <<<<< BESI14 >>>>> <RLGAP:CELL=ALL; CELL CHANNEL GROUP ALLOCATION DATA CELL CHGR SAS ODPDCHLIMIT BUNYM18 0 MULTI 100 -------- desired format... (1 Reply)
Discussion started by: dattatraya
1 Replies

4. Shell Programming and Scripting

track the errors in log file

OS: SuSE Linux Enterprise Server 10 Goal: To track the errors in log file, If they exits users will be notify by email. We have a script below: SrchKey="SRVE0242I:" LogFile=/PATHtemOut.log MailTo="DN@mail.com http:// ! -f PATH/alert.last && touch PATH/alert.last egrep $SrchKey $LogFile... (3 Replies)
Discussion started by: sdhn1900
3 Replies

5. UNIX for Dummies Questions & Answers

Log in as root and it errors out

Hello I tried to log in as root, through console access, and this is what I got. >root ksh: root: not found Can you tell me why I got this and what causes it. Thanks. (2 Replies)
Discussion started by: iamnew2solaris
2 Replies

6. Solaris

about log errors

How would you truncate a log file that is growing too large if you don't have space to compress it or to move it somewhere else? How would you do it? (2 Replies)
Discussion started by: rajaramrnb
2 Replies

7. Linux

Filter log file contents between date

Hi, Could you please provide me command to filter contents between date in a log file? Say for example, in a log file I want to capture contents between date May 01 from 5am to 9 am. OS -- Linux Regards, Maddy (1 Reply)
Discussion started by: Maddy123
1 Replies

8. Shell Programming and Scripting

Outputting Errors to a Log file

Good Morning, Every so often, I have copy scripts that to don't complete, but I don't immediately know why. It usually ends up being a permissions issue or a length issue. The scripts edit a log file, so I'd like to include any copy errors/issues in that file to check if the copies... (4 Replies)
Discussion started by: Stellaman1977
4 Replies

9. Shell Programming and Scripting

Can we filter the below log data into CSV format?

HI , I m looking for help here!!! Can we filter the below log data into CSV format ? timestamp INFO <text > - Some text Drive .. Need a format of separate field such as 1 2 3 4 ... (2 Replies)
Discussion started by: MohSalNiz
2 Replies

10. UNIX for Beginners Questions & Answers

Filter records from a log file based on timestamp

Dear Experts, I have a log file that contains a timestamp, I would like to filter record from that file based on timestamp. For example refer below file - cat sample.txt Jan 19 20:51:48 mukul-Vostro-14-3468 systemd: pam_unix(systemd-user:session): session opened for user root by (uid=0)... (6 Replies)
Discussion started by: mukulverma2408
6 Replies
SEQWORDS(1e)						     EMBOSS Manual for Debian						      SEQWORDS(1e)

NAME
seqwords - Generates DHF files from keyword search of UniProt. SYNOPSIS
seqwords -keyfile infile -spfile infile -outfile outfile seqwords -help DESCRIPTION
seqwords is a command line program from EMBOSS ("the European Molecular Biology Open Software Suite"). It is part of the "Protein:3D Structure" command group(s). OPTIONS
Input section -keyfile infile This option specifies the name of keywords file (input). This contains a list of keywords specific to a number of SCOP or CATH families and superfamilies used by SEQWORDS to search a sequence database. -spfile infile This option specifies the name of the sequence database (input) to search. Output section -outfile outfile This option specifies the name of the DHF file (domain hits file) (output). A 'domain hits file' contains database hits (sequences) with domain classification information, in the DHF format (FASTA-like). The hits are relatives to a SCOP or CATH family (or other node in the structural hierarchies) and are found from a search of a sequence database. Files containing hits retrieved by PSIBLAST are generated by using SEQSEARCH, hits retrieved by a sparse protein signatare by using SIGSCAN or various types of HMM and profile by using LIBSCAN. Default value: test.hits BUGS
Bugs can be reported to the Debian Bug Tracking system (http://bugs.debian.org/emboss), or directly to the EMBOSS developers (http://sourceforge.net/tracker/?group_id=93650&atid=605031). SEE ALSO
seqwords is fully documented via the tfm(1) system. AUTHOR
Debian Med Packaging Team <debian-med-packaging@lists.alioth.debian.org> Wrote the script used to autogenerate this manual page. COPYRIGHT
This manual page was autogenerated from an Ajax Control Definition of the EMBOSS package. It can be redistributed under the same terms as EMBOSS itself. DOMSEARCH 0.1.0++20100721 08/11/2010 SEQWORDS(1e)
All times are GMT -4. The time now is 08:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy