11-17-2008
Help with separating syslog messages.
Hello Guys...
I am bit new to shell scripting and was looking for help !!
I have got syslog data on a linux server recording log messages from a device.
I need to seperate the data from log to file so that I can push it excell and get a report from that.
Log is in the format below
"
Nov 16 04:02:05 syslogger syslog: klogd startup succeeded
Nov 16 04:02:05 syslogger syslog: syslogd shutdown succeeded
Nov 16 04:02:08 syslogger crond(pam_unix)[28955]: session closed for user root
Nov 16 04:19:49 10.0.3.1 287352 11/16/2008 01:41:12.150 SEV=4 IKE/119 RPT=6730 123.208.8.179 Group [sportsbet] User [munsieg] PHASE 1 COMPLETED
Nov 16 04:20:02 10.0.3.1 287364 11/16/2008 01:41:24.290 SEV=4 IKE/49 RPT=7502 12
3.208.8.179 Group [sportsbet] User [munsieg] Security negotiation complete for
User (munsieg) Responder, Inbound SPI = 0x05347b8f, Outbound SPI = 0x9bd2c940"
Is there a way to separate things in bold from the log and push it to a text or excell file ?
Thanks a lot for the help..!!
R
10 More Discussions You Might Find Interesting
1. Programming
hey there
well i have a small problem with my code. when for example :
" /bin/sleep 10 & ls -l mila > xyz " is entered, the program is supposed to separate the two commands 1) /bin/sleep 10 & and 2) ls -l mila > xyz. im not sure of how to achieve this. my current program stores both commands... (2 Replies)
Discussion started by: mile1982
2 Replies
2. Shell Programming and Scripting
Hi,
i have a file as follows:
jonathan:bonus1,bonus2
gerald:bonus1
patrick:bonus1,bonus2
My desired output is
jonathan:bonus1
jonathan:bonus2
gerald:bonus1
patrick:bonus1
patrick:bonus2
my current code is
cat $F | awk -F""
how should i continue the code? Can i do something... (5 Replies)
Discussion started by: new2ss
5 Replies
3. Programming
Hi i have encountered a problem and i have tried many different things but my brain just has some limitations lol well anyways i was trying to make this program work down below so i can process multiple commands just by separating them with ;. I would apeciate if someone could just make it work kuz... (2 Replies)
Discussion started by: dush_19
2 Replies
4. Shell Programming and Scripting
Hi (warning: newbie question),
I am writing a script to run a series of tests on a program, which involves a line:
for file in `ls test_suite/*.args`
but later I want to send the output to file.out. But I need to separate the filename and extension somehow...Also $file contains... (2 Replies)
Discussion started by: lucaspewkas
2 Replies
5. Shell Programming and Scripting
Hi,
I have a text file in following format:
2.45
5.67
6.43
I have to cut the values before decimal and store them in a file.
So the output file should look like:
2
5
6
.
.
and so on...
Can someone suggest me a sed/awk command for doing this? (2 Replies)
Discussion started by: sajal.bhatia
2 Replies
6. Shell Programming and Scripting
I have folder like main. inside main folder there are subfolders & files like main1 main2 main3, file1, file2, file3.
I want folders main1 & main2, file1, file2 from main folder. copy them into new folder.
Please suggest me how to do it.
I am new to shell programming (2 Replies)
Discussion started by: ypremcha
2 Replies
7. Shell Programming and Scripting
Hi all,
I have a single text file, Contig3.fasta, that looks like this:
>NAME1
ACCTGGTA
>NAME2
GGTTGGACA
>NAME3
ATTTTGGGCCAnd It has about 100 items like this in it. What I would like to do is copy each item into 100 different text files, and have them named a certain way
Output... (4 Replies)
Discussion started by: repiv
4 Replies
8. Shell Programming and Scripting
Hi
I have this output
/vol/vol0 4GB
/vol/nonprod00 682GB
/vol/prod00 3GB
/vol/nasp_archive 201GB
/vol/nasp_iface 92GB
/vol/nasp_bsi 0GB
/vol/nasp_vertex 0GB
/vol/nasp_sapmnt_mp2 1GB
/vol/nasp_sapmnt_prd 52GB
/vol/nasp_sapmnt_srp 1GB
/vol/nasp_smd 1GB
/vol/nasp_ccms 0GB... (8 Replies)
Discussion started by: bombcan
8 Replies
9. Shell Programming and Scripting
Hi All,
I am new to unix but have a requirement wherein I need to separate datatype,length, and column name from input file which is of below format --
record
integer(10) empid;
string(25) name;
date("YYYY-MM-DD") dob;
decimal(10) salary;
end
now after getting datatype,its length and... (4 Replies)
Discussion started by: phoenix09
4 Replies
10. Shell Programming and Scripting
Hello,
I have a text file running into around 100 thousand+ lines which has the following rigid structure:
Each field is separated by a comma.
Some examples are given below:
23,Chinttaman Pagare,चिंतमण पगारे
24, Chinttaman Pateel,चिंतामण पाटल
25, Chinttaman Rout,चिंतामण राऊत
26,... (3 Replies)
Discussion started by: gimley
3 Replies
LEARN ABOUT DEBIAN
logger
LOGGER(1) User Commands LOGGER(1)
NAME
logger -- a shell command interface to the syslog(3) system log module
SYNOPSIS
logger [-dhisV] [-f file] [-n server] [-P port] [-p pri] [-t tag] [-u socket] [message]
DESCRIPTION
logger makes entries in the system log. It provides a shell command interface to the syslog(3) system log module.
Options:
-d, --udp
Use datagram (UDP) instead of the default stream connection (TCP).
-i, --id
Log the process ID of the logger process with each line.
-f, --file file
Log the contents of the specified file. This option cannot be combined with a command-line message.
-h, --help
Display a help text and exit.
-n, --server server
Write to the specified remote syslog server using UDP instead of to the builtin syslog routines.
-P, --port port
Use the specified UDP port. The default port number is 514.
-p, --priority priority
Enter the message into the log with the specified priority. The priority may be specified numerically or as a facility.level pair.
For example, -p local3.info logs the message as informational in the local3 facility. The default is user.notice.
-s, --stderr
Output the message to standard error as well as to the system log.
-t, --tag tag
Mark every line to be logged with the specified tag.
-u, --socket socket
Write to the specified socket instead of to the builtin syslog routines.
-V, --version
Display version information and exit.
-- End the argument list. This is to allow the message to start with a hyphen (-).
message Write the message to log; if not specified, and the -f flag is not provided, standard input is logged.
The logger utility exits 0 on success, and >0 if an error occurs.
Valid facility names are: auth, authpriv (for security information of a sensitive nature), cron, daemon, ftp, kern (can't be generated from
user process), lpr, mail, news, security (deprecated synonym for auth), syslog, user, uucp, and local0 to local7, inclusive.
Valid level names are: alert, crit, debug, emerg, err, error (deprecated synonym for err), info, notice, panic (deprecated synonym for
emerg), warning, warn (deprecated synonym for warning). For the priority order and intended purposes of these levels, see syslog(3).
EXAMPLES
logger System rebooted
logger -p local0.notice -t HOSTIDM -f /dev/idmc
logger -n loghost.example.com System rebooted
SEE ALSO
syslog(3), syslogd(8)
STANDARDS
The logger command is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible.
AVAILABILITY
The logger command is part of the util-linux package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/.
util-linux August 2011 util-linux