Questions tagged [tail]

Output the last part of files.

Output the last part of files, print the last part (10 lines by default) of each FILE; tail reads from standard input if no files are given or when given a FILE of `-'.

Manpage

96 questions
1
vote
1 answer

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 <> Currently I'm doing something…
Rick
  • 299
  • 1
  • 4
  • 12
1
vote
2 answers

CLI security program via tail

I am looking for a cli (command line interface) program that would basically tail either 1 log or a set of logs in /var/log and on the fly output in a more friendly manner. Perl would be best but isn't a prerequisite.
Unfundednut
  • 372
  • 4
  • 17
1
vote
3 answers

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 data from stdin, but this overrides any key variable…
skyler
  • 465
  • 3
  • 8
  • 17
1
vote
1 answer

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? I tried ftrace and tried this: tail -f trace…
kumar
  • 433
  • 3
  • 10
  • 23
1
vote
3 answers

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/my-application.log | awk ' BEGIN { ORS=" " } {…
jg3
  • 169
  • 1
  • 6
1
vote
2 answers

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 will do this (i.e. grab something that looks like a…
1
vote
3 answers

Applications to tail httpd logs over ssh in windows besides a ssh terminal

I'm looking for something like baretail with ssh support or the ability to read from standard input so I can pipe the output of plink. Does anyone have any suggestions.
Justin Dearing
  • 1,037
  • 12
  • 33
1
vote
3 answers

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 has something similar Tail isn't very useful as…
1
vote
3 answers

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 work wile tail is running. Nor does tee works tail -f…
shantanuo
  • 3,579
  • 8
  • 49
  • 66
1
vote
1 answer

NFS server and delay in using tail -f?

We have two Solaris servers, let's call them Alice and Bob. We also have a Solaris NFS server used by both of them, call it Charlie. Alice writes to a text logfile on the NFS server, which is then read by Bob, who acts on events in that logfile. The…
victorhooi
  • 515
  • 3
  • 11
  • 20
1
vote
4 answers

Count amount of new lines with interval in log

Is there a way/tool to tail or watch a logfile and report the amount of lines it grows? E.g. I want to see the amount of new entries in mysql.log every 3 seconds. watch wc -l /path/to/log.log1 shows only acumulated amount. I'd prefer not to…
berkes
  • 2,205
  • 3
  • 18
  • 19
1
vote
1 answer

tail -F still stops on logrotate sometimes

Linux ip-10-10-64-122 4.1.7-15.23.amzn1.x86_64 #1 SMP Mon Sep 14 23:20:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux I'm using tail -F in a bash script which in turn loops over the results. This script is supposed to run indefinitely tail -F…
pstanton
  • 623
  • 3
  • 11
  • 23
1
vote
2 answers

Systemd starts unknown openvpn instances - how could I disable this?

this is my output by tail -f /var/log/syslog/. May 26 08:02:29 ovpn-server systemd[1]: openvpn-server@ovpn-42.service: Main process exited, code=exited, status=1/FAILURE May 26 08:02:29 ovpn-server systemd[1]: openvpn-server@ovpn-42.service: Failed…
ikreb
  • 113
  • 7
0
votes
2 answers

redirect tail output to a remote serever

I want to tail -f a local file, for example app1.log, and send its output to a file on a remote server. tail -f app1.log >> :/home/remote.log Is this doable?
0
votes
2 answers

Count instances of a pattern's match in a real-time log file, in a specific time frame, using PowerShell?

I've to intercept a pattern in a log file and, when this pattern is matched for 5 times in 5 minutes, send an alert... I've wrote this lines, but I'm stuck... I don't know how to handle the time frame... Can you help me please? Roberto. $count =…
ilRobby
  • 1
  • 3