Sponsored Content
Full Discussion: Parsing syslog from Linux
Top Forums Shell Programming and Scripting Parsing syslog from Linux Post 303037004 by arm on Saturday 20th of July 2019 01:48:27 PM
Old 07-20-2019
In fact , I tried my script took long time to be processed , the size of syslog is about 2 GB and process time was about 6 minutes which is too long ...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need some help with parsing

I have a big xml file with little formatting in it. It contains over 600 messages that I need to break each message out in its own separate file. The xml file looks in the middle of it something like this: </Title></Msg><Msg><Opener> Hello how are you?<Title> Some says hello</Title><Body>... (3 Replies)
Discussion started by: quixoticking11
3 Replies

2. Shell Programming and Scripting

Perl parsing compared to Ksh parsing

#! /usr/local/bin/perl -w $ip = "$ARGV"; $rw = "$ARGV"; $snmpg = "/usr/local/bin/snmpbulkget -v2c -Cn1 -Cn2 -Os -c $rw"; $snmpw = "/usr/local/bin/snmpwalk -Os -c $rw"; $syst=`$snmpg $ip system sysName sysObjectID`; sysDescr.0 = STRING: Cisco Internetwork Operating System Software... (1 Reply)
Discussion started by: popeye
1 Replies

3. Shell Programming and Scripting

Parsing of file for Report Generation (String parsing and splitting)

Hey guys, I have this file generated by me... i want to create some HTML output from it. The problem is that i am really confused about how do I go about reading the file. The file is in the following format: TID1 Name1 ATime=xx AResult=yyy AExpected=yyy BTime=xx BResult=yyy... (8 Replies)
Discussion started by: umar.shaikh
8 Replies

4. Red Hat

Parsing a linux file and formatting it.

Hi, I have a linux file that has data like this.. REQUEST_ID|text^Ctext^Ctext^C REQUEST_ID|text^Ctext^C REQUEST_ID| REQUEST_ID| REQUEST_ID|text^Ctext^Ctext^Ctext^Ctext^Ctext^C.... Where ever I see a ^C character, I need to copy the corresponding REQUEST_ID and that part of the text to a new... (17 Replies)
Discussion started by: charithainfadev
17 Replies

5. Shell Programming and Scripting

Parsing kiwi syslog from Astaro

Hello, I am trying to parse this syslog pulling out and logging results to a file. The information I want is: scrip, scrport, dstip, dstport. I just want the numbers, not including the text part ie srcip=". Problem is, the column locations change, so I can't use the nice awk $1 $2 etc to... (4 Replies)
Discussion started by: rmelnik
4 Replies

6. UNIX for Dummies Questions & Answers

Parsing linux commands through FTP

Hi Techies, I have made a shell script which stores the output of it in a text file. then i wanted to fetch that text file using windows scheduler in my windows xp desktop which i did successfully using the below mentioned ftp .bat file : @echo off @echo ftp_user>ftp_test.scr @echo... (0 Replies)
Discussion started by: gemnian.g
0 Replies

7. Shell Programming and Scripting

Help - Parsing data in XML in Linux

Hi, I have an XML file in Linux and it contains a long string of characters. The last part of the file is like ....... ....... ....... CAD</MarketDescription></InvestorTransaction></AdvisorAccount></DivisionAdvisor></Division>... (3 Replies)
Discussion started by: naveed
3 Replies

8. Shell Programming and Scripting

Specific string parsing in Linux/UNIX

Hi, I have a string which can be completely unstructred. I am looking to parse out values within that String. Here is an example <Random Strings> String1=<some number a> String2=<some number b> String3=<some number c> Satish=<some number d> String4=<some number e> I only want to parse out... (1 Reply)
Discussion started by: satishrao
1 Replies

9. SuSE

Location and name of SYSLOG in SUSE Linux

Esteemed listers, Where is the location of SYSLOG file? In etc/auditd.conf script, the log_file location is '/var/log/audit/audit.log' as below. Is this the location where SYSLOG is stored? Thank you in advance, log_file = /var/log/audit/audit.log log_format = RAW... (3 Replies)
Discussion started by: JDBA
3 Replies

10. Programming

Openlog and syslog in red-hat Linux doesn't write any thing to /var/log/*

Using redhat 64 bit ver 6.2 I have simple c++ app that is trying to write to syslog like this: /* try to write massage into linux log */ void foo::writeToSyslog() { openlog("testlogfoo", 0, 24); // Send the message. ... (1 Reply)
Discussion started by: umen
1 Replies
sa1(1M) 																   sa1(1M)

NAME
sa1, sa2, sadc - system activity report package SYNOPSIS
[t n] time] time] sec] [t n] [ofile] DESCRIPTION
System activity data can be accessed at the special request of a user (see sar(1M)) and automatically on a routine basis as described here. The operating system contains a number of counters that are incremented as various system actions occur. These include CPU utilization counters, buffer usage counters, activity counters for disk, lunpath, HBA, tape I/O, and tty devices, switching and system-call counters, file-access counters, queue activity counters, and counters for inter-process communications. and shell procedures and are used to sample, save, and process this data. the data collector, samples system data n times every t seconds and writes in binary format to ofile or to standard output. If t and n are omitted, a special record is written. This facility is used at system boot time to mark the time at which the counters restart from zero. Executing the following command in a system startup script: writes the special record to the daily data file to mark the system restart. Instructions for creating system startup scripts may be found in the which is online on The shell script a variant of is used to collect and store data in binary file where dd is the current day. The arguments t and n cause records to be written n times at an interval of t seconds, or once if omitted. The following entries, if placed in produce records every 20 minutes during working hours and hourly otherwise (see cron(1M)): The shell script a variant of writes a daily report in file The options are explained in sar(1M). The following entry reports important activities hourly during the working day: Structure of the binary daily data file lists information about the active processors. The structure of the binary daily data file is: struct sa { long version[PST_MAX_CPUSTATES]; /* sadd file version */ psetid_t psetid[SAR_MAX_PROCS][2]; /* mapping of psetid and cpus in the * system */ int cpus[SAR_MAX_PROCS]; /* active processors list */ unsigned long long cpu [PST_MAX_CPUSTATES]; /* average time spent in each state */ unsigned long mp_cpu [SAR_MAX_PROCS][PST_MAX_CPUSTATES]; /* per proc cpu time */ unsigned long proc_cnt; /* MP: number of active processors */ unsigned long max_proc_cnt; /* MP: max active processors */ unsigned long bread; /* transfer of data between system * buffers and disk or other block devices */ unsigned long bwrite; unsigned long lread; /* access of system buffers */ unsigned long lwrite; unsigned long phread; /* transfer via physical device mechanism */ unsigned long phwrite; unsigned long swapin; /* number of swap transfers */ unsigned long swapout; unsigned long bswapin; /* number of 512-bytes transferred * (for bswapin:include initial loading of * some programs */ unsigned long bswapout; unsigned long pswitch; /* process switches */ unsigned long syscall; /* system calls of all types */ unsigned long sysread; /* specific system calls */ unsigned long syswrite; /* number of write() system calls */ unsigned long sysfork; /* number of fork() system calls */ unsigned long sysexec; /* number of exec() system calls */ unsigned long runque; /* run queue of processes in memory and * runable */ unsigned long runocc; /* time occurring */ unsigned long mp_runque [SAR_MAX_PROCS]; unsigned long mp_runocc [SAR_MAX_PROCS]; unsigned long swpque; /* swap queue of processes swapped */ * out but ready to run. */ unsigned long swpocc; unsigned long iget; /* use of file access system routines */ unsigned long namei; unsigned long dirblk; /* number of directory blocks encountered */ unsigned long readch; /* characters transferred by read system * calls */ unsigned long writech; /* characters transferred by write system * calls*/ unsigned long rcvint; /* receive interrupt */ unsigned long xmtint; /* transfer interrupt */ unsigned long mdmint; /* modem interrupt */ unsigned long rawch; /* input character */ unsigned long canch; /* input character processed by cannon */ unsigned long outch; /* output character */ unsigned long msg; /* message primitive */ unsigned long sema; /* semaphore primitive */ unsigned long select; /* select system calls */ unsigned int sztext; /* current size of text table */ unsigned int szinode; /* current size of inode table */ unsigned int szfile; /* current size of file table */ unsigned int szproc; /* current size of proc table */ unsigned int msztext; /* maximum size of text table */ unsigned int mszinode; /* maximum size of inode table */ unsigned int mszfile; /* maximum size of file table */ unsigned int mszproc; /* maximum size of proc table */ unsigned long inodeovf; /* cumulative overflows of inode table */ * since boot */ unsigned long fileovf; /* cumulative overflows of file table */ * since boot */ unsigned long procovf; /* cumulative overflows of proc table */ * since boot */ time_t ts; /* time stamp */ unsigned long elements_in_use; long elements[20]; }; WARNINGS
This structure can change in future releases, with no support for backward compatibility. FILES
address file daily data file daily report file SEE ALSO
timex(1), cron(1M), sar(1M), intro(7). on STANDARDS CONFORMANCE
sa1(1M)
All times are GMT -4. The time now is 02:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy