Sponsored Content
Top Forums Shell Programming and Scripting Redirect all logs files contents into a single log file Post 302626297 by itkamaraj on Thursday 19th of April 2012 06:34:20 AM
Old 04-19-2012
Code:
 
ls p*.txt > files.txt
 
sort files.txt | while read file
do
    cat "$file" >> accumulatedlog.txt
    echo "" >> accumulatedlog.txt
done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to divide single large log file into multiple files.

Can you please help me with writing script for following purpose. I have to divide single large web access log file into multiple log files based on dates inside the log file. For example: if data is logged in the access file for jan-10-08 , jan-11-08 , Jan-12-08 then make small log file... (1 Reply)
Discussion started by: kamleshm
1 Replies

2. 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

3. Shell Programming and Scripting

not able to redirect the logs of a singl date in one system

Hi All, I have around 15 servers. I need to check for the error in /var/adm/messages in 15 servers of current date everyday and log it in one server. rsh is configured in all servers. The command I am using to accomplish this in shell script is rsh <remote sever> grep 'Jun 17'... (2 Replies)
Discussion started by: partha_bhunia
2 Replies

4. Shell Programming and Scripting

Search a pattern in a file with contents in a single line

Hi all I am searching for a pattern in a file . The file content is in a single line.If am doing a grep or sed for the a particular pattern am getting whole file. I want the result in different lines. attaching the file for reference search pattern "/xxxxxx/hhhh/tttttttt/sss/" and... (4 Replies)
Discussion started by: sparks
4 Replies

5. Shell Programming and Scripting

Parsing log files, displaying logs between specific dates

Sorry, couldn't really think of a simple subject/title. So, I have a log file, and the dates are displayed like so: 2009-03-05 02:49:44 So the first and second field are the date/time. I can change them into a unix timestamp easily with: date -d "2009-03-05 02:49:44" +%s However,... (17 Replies)
Discussion started by: Rhije
17 Replies

6. Debian

Logrotate truncated my log files to 0 bytes and no logs are written

Hi, Yesterday I installed and configured logrotate on my Debian machine. I was expecting this to run at 06:25 in the morning and it actually did. All my old logs were compressed and zipped but the new logs were all with size equal to 0 bytes. Processes, while still running ok, they were not... (2 Replies)
Discussion started by: pmatsinopoulos
2 Replies

7. Shell Programming and Scripting

Perl script to Merge contents of 2 different excel files in a single excel file

All, I have an excel sheet Excel1.xls that has some entries. I have one more excel sheet Excel2.xls that has entries only in those cells which are blank in Excel1.xls These may be in different workbooks. They are totally independent made by 2 different users. I have placed them in a... (1 Reply)
Discussion started by: Anamika08
1 Replies

8. Shell Programming and Scripting

Tailing logs from different files into one single file

Hi Please help me in finding a solution for tailing multiple log files and writing all of them into one common file. I have 4 log files with same name in 4 different folders. Whenever I post a Request - any one of these 4 log files gets updated with some log detail in the below format : ... (5 Replies)
Discussion started by: nisav
5 Replies

9. Shell Programming and Scripting

Paste 2 single column files to a single file

Hi, I have 2 csv/txt files with single columns. I am trying to merge them using paste, but its not working.. output3.csv: flowerbomb everlon-jewelry sofft steve-madden dolce-gabbana-watchoutput2.csv: http://www1.abc.com/cms/slp/2/Flowerbomb http://www1.abc.com/cms/slp/2/Everlon-Jewelry... (5 Replies)
Discussion started by: ajayakunuri
5 Replies

10. UNIX for Beginners Questions & Answers

Output file name and file contents of multiple files to a single file

I am trying to consolidate multiple information files (<hostname>.Linux.nfslist) into one file so that I can import it into Excel. I can get the file contents with cat *Linux.nfslist >> nfslist.txt. I need each line prefaced with the hostname. I am unsure how to do this. --- Post updated at... (5 Replies)
Discussion started by: Kentlee65
5 Replies
MERGELOGS(1)						      General Commands Manual						      MERGELOGS(1)

NAME
mergelogs - merge and consolidate web server logs SYNOPSIS
mergelogs -p penlog [-c] [-d] [-j jitter] [-t seconds] server1:logfile1 [server2:logfile2 ...] EXAMPLES
mergelogs -p pen.log 10.0.0.1:access_log.1 10.0.0.2:access_log.2 mergelogs -p pen.log 10.0.18.6:access_log-10.0.18.6 10.0.18.8:access_log-10.0.18.8 DESCRIPTION
When pen is used to load balance web servers, the web server log file lists all accesses as coming from the host running pen. This makes it more difficult to analyze the log file. To solve this, pen creates its own log file, which contains the real client address, the time of the access, the target server address and the first few bytes of the requests. Mergelogs reads pen's log file and the log files of all load balanced web servers, compares each entry and creates a combined log file that looks as if the web server cluster were a single physical server. Client addresses are replaced with the real client addresses. In the event that no matching client address can be found in the pen log, the server address is used instead. This should never happen, and is meant as a debugging tool. A large number of these indicates that the server system date needs to be set, or that the jitter value is too small. You probably don't want to use this program. Penlog is a much more elegant and functional solution. OPTIONS
-c Do not cache pen log entries. The use of this option is not recommended, as it will make mergelogs search the entire pen log for every line in the web server logs. -d Debugging (repeat for more). -p penlog Log file from pen. -j jitter Jitter in seconds (default 600). This is the maximum variation in time stamps in the pen and web server log files. A smaller value will result in a smaller pen log cache and faster processing, at the risk of missed entries. -t seconds The difference in seconds between the time on the pen server and UTC. For example, this is 7200 (two hours) in Finland. server:logfile Web server address and name of log file. AUTHOR
Copyright (C) 2001-2003 Ulric Eriksson, <ulric@siag.nu>. SEE ALSO
pen(1), webresolve(1), penlog(1), penlogd(1) LOCAL MERGELOGS(1)
All times are GMT -4. The time now is 01:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy