Sponsored Content
Top Forums Shell Programming and Scripting How to tail -f multi logfile in 1 shell script.? Post 302801327 by ooilinlove on Wednesday 1st of May 2013 11:58:23 PM
Old 05-02-2013
Hammer & Screwdriver How to tail -f multi logfile in 1 shell script.?

Hello,

How to tail -f multi logfile from multi path in 1 shell script.

File & Path
Code:
/usr/home/localmode/mode110l/log/logic/number110/digit110_digit110m4_2013050210.txt
/usr/home/localmode/mode103l/log/logic/number103/digit103_digit103m4_2013050210.txt
/usr/home/localmode/modegwl/log/logic/number140/digit140_digitgwm10_2013050210.txt
/usr/home/localmode/modegwl/log/logic/number102/digit102_digitgwm10_2013050210.txt

I need output as below
tail -f log file in 1 shell script and 1 wondow
O/P:

Code:
tail-f /usr/home/localmode/mode110l/log/logic/number110/digit110_digit110m4_2013050210.txt
2013-05-02 10:56:09,465|1|
2013-05-02 10:56:09,689|1|
2013-05-02 10:56:09,902|1|
2013-05-02 10:56:09,915|1|

------------------------------------------------------------------------------------------
tail-f /usr/home/localmode/mode103l/log/logic/number103/digit103_digit103m4_2013050210.txt
2013-05-02 10:56:10,067|1|
2013-05-02 10:56:10,129|1|
2013-05-02 10:56:10,131|1|

------------------------------------------------------------------------------------------
tail-f /usr/home/localmode/modegwl/log/logic/number140/digit140_digitgwm10_2013050210.txt
2013-05-02 10:56:10,895|1|
2013-05-02 10:56:11,283|1|
2013-05-02 10:56:11,881|1|
2013-05-02 10:56:14,072|3|
2013-05-02 10:56:15,323|1|
2013-05-02 10:56:15,528|1|
2013-05-02 10:56:15,578|1|

------------------------------------------------------------------------------------------
tail-f /usr/home/localmode/modegwl/log/logic/number102/digit102_digitgwm10_2013050210.txt
2013-05-02 10:56:15,604|1|
2013-05-02 10:56:15,628|1|
2013-05-02 10:56:15,768|1|

------------------------------------------------------------------------------------------

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Korn Shell Script to find out error in logfile

Hi All, I am new to this forum as well as to unix scripting. Can you please help me to create a korn shell script to find out errors in logfiles and get the name of that logfile ( which is having error) in email and email it to me? (2 Replies)
Discussion started by: jithu
2 Replies

2. Shell Programming and Scripting

Grep or Tail in shell script

Hi, I am writing a shell script that checks catalina logs on a production system and mails me if it detects errors. It greps the logs for known errors which i have defined as variables. The problem is the logs are huge, approx 30,000 before they rotate. So I am forced to use grep instead... (3 Replies)
Discussion started by: Moxy
3 Replies

3. Shell Programming and Scripting

Reading multi lines variable using shell script

Hi, I am using #!/bin/sh shell. I have a variable which contains multi line data. I want to read that variable line by line. Can someone post the code to read the multi line variable line by line? Any help is much appreciated. (2 Replies)
Discussion started by: gupt_ash
2 Replies

4. Shell Programming and Scripting

generate logfile in a shell script

Unix Gurus, I have a shell script which has few "echo" statements. I am trying to create a logfile where all the outputs of the echo statement sare stored. I will have to add this as the final step in the existing script so that everytime the script runs, a logfile is generated with all the... (1 Reply)
Discussion started by: shankar1dada
1 Replies

5. Shell Programming and Scripting

How to tail -f logfile. if log file is generate every 1 HR.?

Hello, How to tail -f logfile. if log file is gennerate every 1 HR. I want it works automatically all the time. never changes it by manual. Thank ls -trl CybertonTransaction.* -rw-r--r-- 1 autobot robot 617071 Jul 9 00:02 CybertonTransaction.20130709-00.log -rw-r--r-- 1 autobot ... (12 Replies)
Discussion started by: ooilinlove
12 Replies

6. UNIX for Dummies Questions & Answers

Shell script to email logfile

Hi, I am trying to write a shell script to send a log file of a query run in oracle.Pls help me I am very new to shell scripting. echo " Checking Activity Spec " sqlplus / as sysdba <<END_SQL @activity_spec_metadata.sql quit;>>logfile END_SQL mailx -s "Checking Activity Spec schedule... (1 Reply)
Discussion started by: Rossdba
1 Replies

7. Shell Programming and Scripting

Logfile monitoring with logfile replacement

Bonjour, I've wrote a script to monitor a logfile in realtime. It is working almost perfeclty except for two things. The script use the following technique : tail -fn0 $logfile | \ while read line ; do ... some stuff done First one, I'd like a way to end the monitoring script if a... (3 Replies)
Discussion started by: Warluck
3 Replies

8. Shell Programming and Scripting

Shell script, sftp logfile not showing transfer information

Hello, Recently I have changed some crontab scripts which I execute to do different tasks mainly transfering some files from one server to the other. The main change was the protocol from ftp transfer to sftp. Ftp server was the MS Windows default service, and Sftp server is an proprietary sw... (4 Replies)
Discussion started by: enux
4 Replies

9. UNIX for Beginners Questions & Answers

Merge multi-lines into one single line using shell script or Linux command

Hi, Can anyone help me for merge the following multi-line log which beginning with a " and line ending with ": into one line. *****Original Log***** 087;2008-12-06;084403;"mc;;SYHLR6AP1D\LNZW;AD-703;1;12475;SYHLR6AP1B;1.1.1.1;0000000062;HGPDI:MSISDN=12345678,APNID=1,EQOSID=365;... (3 Replies)
Discussion started by: rajeshlinux2010
3 Replies

10. UNIX for Beginners Questions & Answers

Shell script to tail a file with unknown numbers

Hello, I would like to write script to tail a file for different environment But the number of lines are keep changing How can I write a script For example: env could : A, B or C and log files could be a.log, b.log and c.log with the number of lines can change say sometimes it 100 last... (9 Replies)
Discussion started by: encrypt_decrypt
9 Replies
SYSLOG(3P)						     POSIX Programmer's Manual							SYSLOG(3P)

PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the correspond- ing Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. NAME
syslog -- log a message SYNOPSIS
#include <syslog.h> void syslog(int priority, const char *message, ... /* argument */); DESCRIPTION
Refer to closelog(). COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2013 Edition, Standard for Information Technol- ogy -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, Copyright (C) 2013 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. (This is POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Stan- dard is the referee document. The original Standard can be obtained online at http://www.unix.org/online.html . Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html . IEEE
/The Open Group 2013 SYSLOG(3P)
All times are GMT -4. The time now is 11:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy