4
votes
2answers
106 views

tail -f, but with line numbers

I'm trying to see how many times foo bar appears in /var/log/foo.log within an arbitrary amount of time on a remote server, but nothing that I've tried so far has worked. I've already got a timer ...
1
vote
2answers
55 views

Mailing out a customised content based on specific search in a logfile

Using below test.sh, I am getting result in dump.txt as below: test.sh: #!/bin/bash #"Maxl-script" zone starts..... essmsh -l admin password -s localhost -i << EOF spool on to 'dump.txt'; ...
1
vote
4answers
153 views

log file: only process entries older than “MMM DD HH:MM:SS”

I need to process my logfile /var/log/mylogs.log. I am only interested in the new entries, lets say, since Jul 20 15:00:00 but the log contains older entries as well. Is there any simple way, how I ...
11
votes
4answers
611 views

How to do a continous 'wc -l' with gnu texttools?

I know of course that cat logfile.txt | wc -l 120 will tell me the number of lines in a file. Whereas tail -f logfile.txt will show me the new lines that another program writes to logfile.txt. ...
1
vote
1answer
143 views

Parse log file for value changes

From this answer I have reduced a log file to this: Timestamp:1359021601 2013-01-17 15:00:01 size: 10G /mnt/SolrFiles/solr/api/ Timestamp:1359025201 2013-01-17 16:00:01 size: 11G ...
1
vote
4answers
205 views

How to process these DHCP logs to be human readable?

I have this input: Sep 23 13:43 192.168.6.200 Sep 23 13:44 192.168.6.166 Sep 23 13:45 192.168.6.200 Sep 23 13:46 192.168.6.166 Sep 23 13:47 192.168.6.200 Sep 23 13:48 192.168.6.166 Sep 23 13:49 ...
14
votes
8answers
6k views

Command to display first few and last few lines of a file

I have a file with many rows, and each row has a timestamp at the starting, like [Thread-3] (21/09/12 06:17:38:672) logged message from code..... So, I frequently check 2 things from this log file. ...
1
vote
1answer
243 views

Tools to dump entries from arbitrary sets of log files between 2 dates

I had a outage incident a few days ago and the support team has asked for any available logs for the period, while thinking about how to do this, it occurred to me that it would be generally handy to ...
5
votes
4answers
1k views

Any (text based) plotting tools in unix toolbox?

I was wondering if there are any generic plotting tools available in the unix toolbox? By plotting I mean simple bars or things you see in many curses based utilities. And by unix toolbox I mean ...
3
votes
4answers
272 views

Shell script or command to Strip text and Binary files excerpts from large Log Files

I need to remove a large binary file (PDF file) from a large log file which is generated daily.This is seriously hogging space on our servers.I need to remove the large PDF from the logs to make the ...
2
votes
2answers
405 views

parsing through log file and printing out regex backreferences

I want to parse my /var/log/maillog to print out the email addresses in "from=<>" and "to=<>" (mainly to do a quick check for false positives in the DNS RBLs that I've configured) A maillog ...
11
votes
6answers
3k views

Best way to follow a log and execute a command when some text appears in the log

I have a server log that outputs a specific line of text into its log file when the server is up. I want to execute a command once the server is up, and hence do something like the following: tail -f ...
14
votes
6answers
18k views

How to cut part from log file?

I have 8 Gb long log file (Rails production log), and I need to cut part between some dates (lines). Which command i have to use, to do this?
9
votes
3answers
1k views

Parsing log files for frequent IP's

So, I hacked this together while undergoing a DDOS attack to pull naughty ips out of my logs. Anyone have any improvements or other suggestions to make it better? Here's the general idea: pull ...