This is assuming it's an already static log file and you aren't "scraping" a file that's being written to at all times.
I forgot to mention that the match has to be in the cs-host field as domains can show up in cs-referer as well. My solution below and thanks for your contribution:
Hi all,
I'm new to shell scripting.
I want to copy initial few lines(say first 10 lines) from a file to another file.
There is no "head" command in our embedded system.
sed & awk is there which I believe will do that, but I dont know how to.
This is linux 2.6 (embedded)
So please help me.... (5 Replies)
Hi all,
I'm new to shell scripting.
I want to copy the first N lines from a file to another file.
Can someone please tell me how this can be done.
Thanks
Himi (2 Replies)
how to copy lines from a log file based on timestamp.
INFO (RbrProcessFlifoEventSessionEJB.java:processFlight:274) - E_20080521_110754_967: rbrAciInfoObjects listing complete!
INFO (RbrPnrProcessEventSessionEJB.java:processFlight:197) - Event Seq: 1647575217; Carrier: UA; Flt#: 0106; Origin:... (1 Reply)
Hi All,
I have a file that gives me new line/output every 5 minutes. I need to create a script that capture new line/output besides "IN CRON_STATUS", in this case the new output is "begin ------ cron_status.sh - -----------".
I want this script to capture the line starting from "begin ------... (0 Replies)
Hi,
I have log file like this:
i want grep the log file without blank lines in column 4. So the file is become like this :
What is the command?
please help me. (1 Reply)
Hello,
I have a text file which I need to check for presence of certain tags, and then copy a subsequent portion of text into another file. The tag matching canbe done with Grep but I do not know how to copy selective lines from one file to another. Is it possible do that?
I checked up some... (8 Replies)
Hi Guys,
I have the following problem. I have original file (org.txt) that looks like this
module v_1(.....)
//arbitrary number of text lines
endmodule
module v_2(....)
//arbitrary number of text lines
endmodule
module v_3(...)
//arbitrary number of text lines
endmodule
module... (6 Replies)
Hi Guys,
I have an awk script that would search the input file for line that starts with a number 3 and copies into a new text file.
I want to extend this script to find the lines that either starts with 3 or a or b and copy all those lines into the new file.
Here is what I have so far:... (1 Reply)
Dear all,
I have stuck with this problem for some days.
I have a very big file, this file can not open by vi command.
There are 200 loops in this file, in each loop will have one line like this:
GWA quasiparticle energy with Z factor (eV)
And I need 98 lines next after this line.
Is... (6 Replies)
OS : RHEL 7.2
Shell : bash
I have a file which has lines like below
I want to copy from 2nd line to the 6th line and copy(redirect) those lines to another file.
$ cat patterns.txt
hello world
hello asia
hello europe
hello africa
hello america
hello antartica
hello... (9 Replies)
Discussion started by: omega3
9 Replies
LEARN ABOUT CENTOS
exigrep
EXIGREP(8) System Manager's Manual EXIGREP(8)NAME
EXIGREP - Search Exim's main log
SYNOPSIS
exigrep [-l] pattern [log file] ...
DESCRIPTION
The exigrep utility is a Perl script that searches one or more main log files for entries that match a given pattern. When it finds a
match, it extracts all the log entries for the relevant message, not just those that match the pattern. Thus, exigrep can extract complete
log entries for a given message, or all mail for a given user, or for a given host, for example.
The -l flag means 'literal', that is, treat all characters in the pattern as standing for themselves. Otherwise the pattern must be a Perl
regular expression. The pattern match is case-insensitive. If no file names are given on the command line, the standard input is read.
If the location of a zcat command is known from the definition of ZCAT_COMMAND in Local/Makefile, exigrep automatically passes any file
whose name ends in COMPRESS_SUFFIX through zcat as it searches it.
BUGS
This manual page needs a major re-work. If somebody knows better groff than us and has more experience in writing manual pages, any patches
would be greatly appreciated.
SEE ALSO exim(8), perlre(1), /usr/share/doc/exim4-base/
AUTHOR
This manual page was stitched together from spec.txt by Andreas Metzler <ametzler at downhill.at.eu.org>, for the Debian GNU/Linux system
(but may be used by others).
March 26, 2003 EXIGREP(8)