Sponsored Content
Top Forums UNIX for Advanced & Expert Users Incremental extract from growing log file. Post 302873935 by one2connect on Wednesday 13th of November 2013 01:04:34 PM
Old 11-13-2013
Incremental extract from growing log file.

We have a log file which has 16 million row. We want to read all the lines appended from the last time we read using sed command

Code:
sed -n '<START_LINE>,<LAST_LINE>p' abc.csv

I can store this last line line so I can give replace that with START_LINE in my next read. The problem is wc -l which would give me the total lines in the file which I can store it as LAST_LINE takes time to read this ever growing huge file Is there a faster way to implement this?

Last edited by Scott; 11-13-2013 at 02:11 PM.. Reason: Please use code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How to check a file in UNIX is closed or growing?

We have a third party tool in UNIX to kick off a 'file copy' job based on a file existance. If a specific file exists in an UNIX directory, another process should start copy the file into another system for further processing. The issue is, the copy job is starting as soon as the file exists in... (6 Replies)
Discussion started by: kslakshm
6 Replies

2. UNIX for Dummies Questions & Answers

.osm file growing

my /etc/.osm file is growing rapidly and logging large amounts of activity. Can anyone tell me what this file is for and what types of information is logged in this file. Thanks in advance for your help!! (1 Reply)
Discussion started by: golfs4us
1 Replies

3. UNIX for Dummies Questions & Answers

Find out the maximum growing file in a mount

I need to find the file that is growing in the mount. Say yesterday the utilised space was 95% but today that is 96%. How do i find the file that is growing in size. Have checked the same with du/df options but was not able to find much. Please suggest the best possible option. (3 Replies)
Discussion started by: raman1605
3 Replies

4. HP-UX

how to redirect the growing contents of log file to another file in unix

how to redirect the growing contents of log file to another file in unix (2 Replies)
Discussion started by: megh
2 Replies

5. Shell Programming and Scripting

Incremental log parser

I have log file that is incremented every second and is rather big. I need monitor error in this file. I do not want to parse it all every time. I want parse it first time then remember last position (as byte for example) All consequent parsing I want to start from last saved position to the... (3 Replies)
Discussion started by: Narcom
3 Replies

6. Shell Programming and Scripting

Script for incremental file

Hi , I have incremental file FILE1 which locate in directory /asd/ This directory contains log files whose name entries goes in FILE1 how to make shell scripts for following condition shell script executes on day1 FILE1 entry ----> 1.log ... (3 Replies)
Discussion started by: kaushik02018
3 Replies

7. Solaris

Growing a file system-SVM

Hi gurus Im a newbie in solaris..I need to extend file system space in solaris 10 which is using SVM..I have a file system /pin02 which is 93% full n needs to be extended..only 3.6 gb avail space left..the file system is not mirrored...normal ufs file system only..can u please tel me t... (6 Replies)
Discussion started by: madanmeer
6 Replies

8. UNIX for Dummies Questions & Answers

Find the file which is growing at high speed

Hi, A log file which is growing at high speed, don't know the name of it. How to find the respective file? Many thanks. (2 Replies)
Discussion started by: venkatesht
2 Replies

9. UNIX for Dummies Questions & Answers

How to check if my log file is growing properly?

Hi All, I want to check if one my log file is updating properly, how can I achieve it. The approach I am trying is to get the file size at two different interval and than comparing it eg : $ ls -ltr | tail -1 | awk '{print $5}' 20480 (7 Replies)
Discussion started by: mukulverma2408
7 Replies

10. Shell Programming and Scripting

How to extract start/end times from log file to CSV file?

Hi, I have a log file (log.txt) that which contains lines of date/time. I need to create a script to extract a CSV file (out.csv) that gets all the sequential times (with only 1 minute difference) together by stating the start time and end time of this period. Sample log file (log.txt) ... (7 Replies)
Discussion started by: Mr.Zizo
7 Replies
IPL(4)							     Kernel Interfaces Manual							    IPL(4)

NAME
ipl - IP packet log device DESCRIPTION
The ipl pseudo device's purpose is to provide an easy way to gather packet headers of packets you wish to log. If a packet header is to be logged, the entire header is logged (including any IP options - TCP/UDP options are not included when it calculates header size) or not at all. The packet contents is also logged after the header. Prepending every packet header logged is a structure containing information relevant to the packet following and why it was logged. The structure's format is as follows: struct ipl_ci { u_long sec; /* time when the packet was logged */ u_long usec; u_long plen; /* length of packet data logged */ u_short hlen; /* length of headers logged */ u_short rule; /* rule number (for log ...) or 0 if result = log */ u_long flags:24; /* XXX FIXME do we care about the extra bytes? */ #if (defined(OpenBSD) && (OpenBSD <= 1991011) && (OpenBSD >= 199606)) u_long filler:8; /* XXX FIXME do we care? */ u_char ifname[IFNAMSIZ]; #else u_long unit:8; u_char ifname[4]; #endif }; In the case of the header causing the buffer to finish on a non-32bit boundary, padding will be `appended' to ensure that the next log entry is aligned to a 32bit boundary. If the packet contents is more then 128 bytes, then only 128 bytes of the packet contents is logged. Should the packet contents finish on a non-32bit boundary, then the last few bytes are not logged to ensure the log entry is aligned to a 32bit boundary. ipl is a read-only (sequential) character pseudo-device. The ioctls which are loaded with this device can be found under ipf(4). The only ioctl which is used for logging and doesn't affect the filter is: ioctl(fd, SIOCIPFFB, int *) This ioctl flushes the log buffer and returns the number of bytes flushed. There is currently no support for non-blocking IO with this device, meaning all read operations should be considered blocking in nature (if there is no data to read, it will sleep until some is made available). SEE ALSO
ipf(4) BUGS
Packet headers are dropped when the internal buffer (static size) fills. FILES
/dev/ipl0 IPL(4)
All times are GMT -4. The time now is 09:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy