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
2
votes
3 answers

tail -f and then exit on matching string

I am trying to configure a startup script which will startup tomcat, monitor the catalina.out for the string "Server startup", and then run another process. I have been trying various combinations of tail -f with grep and awk, but haven't got…
Patrick
  • 192
  • 1
  • 3
  • 10
2
votes
1 answer

Multitail configuration:defaultcscheme isn't applied

Finally i got Multitail to work. The only problem is the Default Colorscheme isn't applied to a file i open with multitail, so have to go to the menu and apply it manually. My multitail.conf looks like this…
user56548
2
votes
2 answers

Bash edit file and keep last 500 lines

I am looking to create a cron job that opens a directory loops through all the logs i have created and deletes all lines but keep the last 500 for example. I was thinking of something along the lines of tail -n 500 filename > filename Would this…
icelizard
  • 732
  • 3
  • 10
  • 20
2
votes
1 answer

Tail log files on multiple servers

Scenario: I have load balanced servers running a web application. To debug I'd like to see the output of the same log file (such as the nginx log) combined into a single stream, e.g. a tail -f on all servers in the same cluster, where one of them is…
Peter Thoeny
  • 141
  • 5
2
votes
3 answers

How to truncate the log file size without losing recent logs?

I want to reduce the log file size to the particular minimum size I tried the truncate command as below $ truncate -s 20M log filename But when I check the truncated file it truncates the recent logs and keeps the old logs When analyzing further I…
jayaprakash R
  • 21
  • 1
  • 5
2
votes
1 answer

tail command retry flag not working with wildcards?

I want to tail a bunch of unknown directories names containing a particular non-existant file, e.g.: tail -F /tmp/*/app.log However that does not work as intended with the wildcard: if I create a file with that path, tail won't start following…
iomv
  • 123
  • 4
2
votes
1 answer

Cron is not running from docker container... failed

I am trying create cron a task in docker container. Everything are configured according to the @VonC 's answer My dockerfile looks like this FROM python:3.6.9 WORKDIR usr/src/mydir COPY requirements.txt . # Add crontab file in the cron…
Shokan Iliyas
  • 21
  • 1
  • 3
1
vote
0 answers

Convert json file to prometheus metrics

I have nginx json access log like this, a file that append sample like this to end of file. { "time": "2019-11-27T08:23:39+00:00", "msec": 1574843019.787, "ip": "91.133.248.69", "agent_name": "firefox", "agent_version": "70", "agent_os":…
1
vote
0 answers

SSH session terminates while tail -f running

For the past year or so, I have found that if I leave a 'tail -f' command running in my terminals for more than a few minutes, the SSH session will disconnect. Before the disconnection occurs, the terminal starts to become sluggish in so much as…
John Rix
  • 133
  • 6
1
vote
2 answers

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' file.csv I monitor the filesize periodically and run…
xendi
  • 414
  • 5
  • 10
  • 22
1
vote
1 answer

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 background. I'm looking for a way to cut the log…
UnS3eN
  • 61
  • 6
1
vote
2 answers

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…
1
vote
1 answer

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 program, that will allow me to tail the…
LarsWA
  • 151
  • 4
1
vote
0 answers

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/glassfish/apache-tomcat-8.5.5/logs # tail -n 20000…
Mladen Adamovic
  • 599
  • 1
  • 3
  • 14
1
vote
1 answer

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" & put it in some shell script to notify me. My concern…
vasco.debian
  • 306
  • 2
  • 13