Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [tail]

Output the last part of files.

0
votes
1answer
13 views

Pass output from the tail to the background script while still displaying data

I have a server and a local PC. When the local PC boots up, I run the following script to display the output from the server logs locally on the PC. /usr/bin/ssh -p '444' 'user@remoteserver' "tail -f ...
2
votes
1answer
40 views

send file difference from redhat to windows

Is there a way to send file content difference from Redhat to a server listening on a specific IP/Port on Windows? I initially thought tail -f command but then comes the IP part, anyone can help me?
1
vote
2answers
81 views

sed removing line breaks tail

In my Python script I needed a fast/efficient way to set a max filesize on a file I'm constantly writing to. Rather than bring the whole thing into py's RAM, I ran this shell command: sed -i '1d' ...
1
vote
1answer
84 views

Tail a massive log file in Windows

Inherited an IIS server when I started a new job. The previous "admin" had no log management policy in place. I'm now staring at a 56GB .log file that was created by a piece of software running in the ...
0
votes
1answer
53 views

Console File Color

Asterisk is generating a log file with following content: #033[1;31mWARNING#033[0m[10505]:#033[1;37mres_phoneprov.c#033[0m:#033[1;37m1232#033[0m #033[1;37mget_defaults#033[0m: #033[1;31mERROR#033[0m[...
0
votes
0answers
360 views

Use `tail` to rotate nginx logs in order have a single log file capped in size

Can use tail to rotate a nginx log file in orderer to have a single log file capped in size? tail -c 1000000 access.log > temp.log mv temp.log access.log kill -USR1 `cat /var/run/nginx.pid` The ...
1
vote
1answer
69 views

Tail application for windows that will track a file across newly created folders

I am working with a product, that every time its windows service is restarted, it creates a new folder with date and timestamp, and starts logging into files in this folder. I am looking for a tail ...
1
vote
1answer
745 views

Continuously tailing a rotating log file with date and time in filename

I have a log file in format log_name_YY-MM-DD_HH_mm.log. The log rotates every couple of hours and the new log is created containing the date and time of it's creation. Sometimes I need to tail the ...
0
votes
1answer
54 views

Is there a way to monitor file access

I need a way to monitor the moment a file is accessed. Something similar to Tail (but for windows). The file that is being accessed is not a text file but a binary (*.wav) file. While it would help if ...
1
vote
0answers
58 views

Grep error or limitation reached on 1.2GB text file?

grep on large file followed by tail produces incorrect result, see proof below. The file is 1.2GB large, but grep should process it as a stream, so where could be a problem? root@condor1796 /home/...
1
vote
1answer
116 views

Using tail -F for monitoring huge file

I came across a requirement where I need to continuously monitor a live (appending) file for a predefined pattern (say a error message), I'm planning to use tail -F [FileName] | grep "pattern" & ...
0
votes
1answer
40 views

Continuously save tail of standard input

I have a program that generates large logs on the standard output. Actually I don't care about the log, but I do want to know the last 1000 lines or so if the program finishes or crashes. I want ...
0
votes
1answer
99 views

Can I filter output from `tail` with the `-f` flag?

I'd like to tail -f the output of access_log on RHEL 6.8 but pipe and grep that output to act as a filter. Is there such an option? That is I'd like live output from: # tail -f error_log | grep <...
2
votes
2answers
4k views

Tail, grep and count the instances found in one command?

I am tailing a files output and grepping for lines with certain data. I don't want to output the data to the screen but instead count the number of instances it found and send that to the screen. The ...
0
votes
3answers
2k views

How to make a cron script for cleaning up a log file? [closed]

I don't usually do this kind of stuff, so I just have to ask. How do I make a script which checks a log file, lets say it's named log.txt, grabs everything but the first 100 000 lines from it to a new ...
2
votes
2answers
235 views

Script to email if grep result is null

its been a long time and I cant seem to remember how to do this. I am trying to grep a logfile for a word or words and email if it does not exist in the last fifteen minutes ( I will be setting a cron ...
7
votes
2answers
5k views

tail -f not following log file in Docker container

I am seeing some strange behavior running the tail -f command inside a Docker container in CoreOS. There are a number of variables I can think of that may be contributing to the problem but I am not ...
5
votes
5answers
4k views

tail all log files in a directory | exclude zipped files

Im trying to find the right command to tail a bunch of log files whilst excluding the zipped files in a set directory. The log files are being zipped as they become oversized. At the moment Im using: ...
0
votes
2answers
78 views

Tail grep what tools are for it

I would like to run the following command: tail -f /var/log/syslog | grep -ri 00:16:CB:1E:AF:CA In Linux but it does not working. How would you interactively grep certain text from log files?
-2
votes
1answer
57 views

Omit certain lines from tail -f [closed]

I like tail -f but I like to omit lines that have a certain string in them. Is this possible? I have seen example to include certain string but not how to omit.
6
votes
1answer
607 views

screen causes “tail -F | grep” to echo unmatched lines

This is Ubuntu (3.13.0-29-generic #53), trying to do a simple bash script to monitor a log file for matching lines. If I do the following, there is no output in the bash shell except for matches, ...
0
votes
1answer
56 views

unknown client in my error.log

I have recently reinstalled my VPS OS and at present do not have any websites in my public_folder. In order to investigate a dovecot error which of course is not my question here, I issued tail -n 20 ...
3
votes
3answers
6k views

Tail a file from ssh and mirror to a local file

To tail a file over ssh, I can use ssh -t remotebox "tail -f /var/log/remote.log" However, it is possible to sync the tail with a local file? So a file automatically mirror the update of the tail ...
0
votes
3answers
128 views

tail -f AND allow text input

I want to create a script that allows some interactivity by tail -f logfile from myService allows text to be entered and sent to myService What I could not solve yet is this two functions working ...
1
vote
3answers
3k views

Capture piped multiline grep output into a variable

I'm using Zabbix's zabbix_sender.sh script to push exception stack traces to my remote Zabbix monitoring server. zabbix_sender.sh requires a key and a value for any data that it sends. It can read ...
0
votes
0answers
329 views

Automatically reconnect ssh session for tailing remote file

I need a solution that basically tails a log file from a remote box... Works on Mac Restores itself whenever I have internet. (I frequently close and open the lid of my macbook) It could be a ...
2
votes
1answer
493 views

Any way that I can feed tshark a live capture written to a file without reading from the start?

I'm capturing traffic from a microtik router to my linux server and writing to a big file. I'm searching for a way to feed from the current file end forward since it is a several GB file and I can't ...
1
vote
1answer
2k views

tail command not updating output for debug files

I know that tail -f /var/log/messages will be keep updating on screen as the contents of file gets updated. But when I tried the same thing with a debug file system's file it is not working , any idea?...
6
votes
5answers
4k views

Tail -f on new files

Is there a way to do something like this: tail -f logs/ and make the stdout to be updated on every line added to each file already present in logs/ and to every file that will be created in logs/ ...
15
votes
2answers
2k views

Bash Prompt Below Output - Background Log Tail

I used to work for a company who had a customised shell for management of one of their products that was running on Linux and I'm looking to replicate a key feature of this shell. All the work was ...
3
votes
3answers
8k views

tail: inotify cannot be used, reverting to polling: Too many open files

tail: inotify cannot be used, reverting to polling: Too many open files I'm running apache and tomcat servers on Ubuntu (AWS ec2). Whenever I try to tail the catalina.out of tomcat I get too many ...
8
votes
5answers
762 views

Adding tail behaviour where enter adds blank lines to less

I love less, which I can use to follow logs with the +F flag (or the ShiftF hotkey), search forwards and backwards, and generally move freely through the document. But there is one thing missing in ...
3
votes
3answers
3k views

Can I tail an http resource?

Is there a way to tail a resource such as http://someserver.com/logs/server.log ? This is what I would do for a local file. tail -F /var/logs/somefile.log I would like something similar to that for ...
1
vote
3answers
1k views

tail-pipe-awk script, fine on Centos but weird on Ubuntu

I wrote a script on CentOS and now I'm trying to run it on Ubuntu and it is behaving unexpectedly. Here's something like the script, which I run under bash: sudo tail -F /var/opt/my-application/log/...
6
votes
1answer
792 views

How to get “tail -f” working on a file located on a Windows share

I'm using a Mac and I have mounted a Windows network disk in my file system using "Connect to Server" in the Finder. In the terminal when i do tail -f on a log file located on said network disk, tail ...
0
votes
2answers
701 views

How to TAIL & EGREP for a specified time range in a BASH script

The subject mostly says it all. I am in charge of a few web servers running Ubuntu 12.04 running Apache2 & I would like to setup APC. Now I understand APC can hit segmentation fault issues when ...
2
votes
3answers
126 views

Detect file update from modification time

Is there a way to see how often a file is being updated? I mean I need to see if the modification time of a file is updated in a dynamic way (same as tail shows if the file is updated in a dynamic way)...
1
vote
2answers
228 views

Grabbing the directory path in a message like “You have new mail in /var/spool/mail/root”

So I often get messages such as You have new mail in /var/spool/mail/root and end up typing/copy-pasting out: tail /var/spool/mail/root, which is a bit cumbersome. Is there a simple command that ...
0
votes
2answers
676 views

How to combine a real-time clock with tail -F

I always run tail -F to keep an eye on a log in a terminal window. The log has a UTC date at the beginning of each entry: [08-Jan-2013 16:24:22] Yo! When I glance at my log window I need to know how ...
8
votes
4answers
7k views

How to watch for count of new lines in tail

I want to do something like this: watch tail -f | wc -l #=> 43 #=> 56 #=> 61 #=> 44 #=> ... It counts new lines of tail each second / Linux, CentOs To be more clear. I have got ...
3
votes
1answer
8k views

tail -f : `tail: logfile.log: file truncated`

I was watching a log file (logfile.log) with tail -f, and after a few minutes, the following message was written to the file: tail: logfile.log: file truncated I've never seen that before and I'm ...
2
votes
3answers
171 views

Search for a log pattern continuously

I am preparing a log watch dog but my concern is tailing always would blow up in some point. Thus, My concern is to monitor the log file always and if a pattern match occurs. Issue some commands on ...
3
votes
2answers
2k views

Countinuous processing of tail -f output [closed]

I have a file where numbers are continuously appended: 1 2 3 4 I want to calculate their mean, also continuously, i.e.: 1 1.5 2 2,5 I don't want to check file periodically, I want to it in the ...
0
votes
3answers
635 views

Live statistics from a log file

I've got nginx running as a load balancer in front of several web servers. I'd like to be able to see live statistics with response time (maybe a histogram of the last 10 seconds?) I think Varnish ...
-1
votes
1answer
256 views

Windows Small Business Server 2011 64 Bit - where to find tail [closed]

I am looking for a tail alternative which can be installed on a Windows Small Business Server 2011 64 Bit (from this old thread)? I tried mTail, LogViewer and both failed. Do you have any suggestion ...
5
votes
2answers
3k views

tail -f without the tail?

Is there a command in Solaris to read a file, and when it gets to the end to stream the way tail does? I need to read the file from the start, and it is a binary file. Information on Solaris and ...
0
votes
3answers
1k views

tool to analyse/grep log files [closed]

Is there any web based GUIs to analyse or in realtime filter/grep log files from apache? log files that are access logs or error logs or postfix logs etc. Edit: I don't mean traffic analysis. Much ...
1
vote
3answers
261 views

Saving the out of tail

The following does not work... tail -f /var/log/mysql/general.log | grep Connect > /home/myfile.txt If I remove the "-f" switch then I am able to save the output to a text file, but it does not ...
1
vote
2answers
3k views

find files and search for within tail

The following is working as expected. find /opt/ -name "somefile.out" -exec grep 'Connection refused' {} \; | more But if I want to search only in the tail of the found files, I can not add tail or ...
2
votes
2answers
574 views

“tail -f” style web application

I've been searching for a small but functional PHP script or similar that I can expose via apache. Basically I'd like what "tail -f /var/log/something" does, but visible via a web browser. I'm finding ...