0
votes
1answer
48 views

Need to grep for specific lines from ongoing log and save it in some file

So, let me start with the overall outcome that i want to achieve. There is just one log, which will have info on certain devices, that i am upgrading. I use "tailf log" to monitor the log. Now, ...
4
votes
2answers
42 views

Can less load lines which were appended to a file after opening?

When I am viewing a log file in less is it possible to make less reload the file to get lines which were appended to that file since it was opened?
2
votes
1answer
351 views

Periodically get new lines from file, possibly logrotated

I'm looking for a fairly simple way (no development involved -- I could write this in Python but I'm hoping there's something already out there). I have a log file (in my case written by rsyslogd). ...
2
votes
3answers
239 views

Exception handling when using tail -f to monitor a log

I have a main script calling the script to do the monitoring. I am trying to catch the exception that the log is missing or not accessible anymore. tail -f is used instead of -F since the logs are ...
3
votes
2answers
734 views

Using tail to follow daily log file in Bash

I have a task to use a bash script to monitor a couple of log files named with the current day, eg. YYYY-MM-DD.log. (1) I used tail -f to follow the file but unable to deal file rotation. Even if ...
2
votes
1answer
625 views

Issue with real-time log inspecting piping tail, grep and cut

I have to inspect a growing log in real time, and I found an issue that makes me miss some lines (I can't understand exactly what lines) using tail -f or tailf, grep and cut. I use grep because I ...
11
votes
4answers
840 views

How to do a continous 'wc -l' with gnu texttools?

I know of course that cat logfile.txt | wc -l 120 will tell me the number of lines in a file. Whereas tail -f logfile.txt will show me the new lines that another program writes to logfile.txt. ...
2
votes
1answer
151 views

Does multitail follow the inode or the file name by default?

For logrotated files one usually uses tail -F instead of tail -f to follow the log file contents. Does multitail(1) automatically follow the name instead of the inode (which likely changes with the ...
4
votes
1answer
874 views

Observe multiple log files in one output

Is there an easy way to do something like tail -f mylogfile but to have the changes of more than one file displayed (maybe with the file name added as prefix to each line)? Or maybe a GUI tool? I am ...
2
votes
3answers
1k views

How do I tail a log file and keep tailing it when the latest one changes date?

I'm using RHEL 4. The normal tail -F file_name*.log doesn't update when the time flips over to 0000. Here's what I've tried so far from searching the web, both of which try to use nested tail: ...
0
votes
3answers
313 views

Graphical logviewer that auto reload when file changes?

I'm wondering if there's a graphical viewer, also it needs to support auto-reloading when log file has changed. ksystemlog doesn't reload automatically.
17
votes
8answers
10k views

Command to display first few and last few lines of a file

I have a file with many rows, and each row has a timestamp at the starting, like [Thread-3] (21/09/12 06:17:38:672) logged message from code..... So, I frequently check 2 things from this log file. ...
5
votes
4answers
2k views

`tail -f` until text is seen

I've got a CI server with a command-line interface that allows me to remotely kick-off a job (jenkins CI server and the jenkins-cli.jar tool). After I kick the job off I tail -f the log (sorry for ...
12
votes
3answers
2k views

monitor files (ala tail -f) in an entire directory (even new ones)

I normally watch many logs in a directory doing tail -f directory/*. The problem is that a new log is created after that, it will not show in the screen (because * was expanded already). Is there a ...
14
votes
4answers
8k views

How to monitor only the last n lines of a log file?

I have a growing log file for which I want to display only the last 15 lines. Here is what I know I can do: tail -n 15 -F mylogfile.txt As the log file is filled, tail appends the last lines to the ...
4
votes
2answers
745 views

Moving average on a log file with awk or other unix utilities?

Scenario: I have a log file that has a few number of entry "classes", like this: R0 dx=0.00500 rb=0.00000 sn=1 3145.88 2.59 0.08 se=21315 id=16190 R0 dx=0.00300 rb=-1.00000 sn=1 3150.40 2.38 0.05 ...
1
vote
3answers
352 views

Is there a way to beep when tail -F stops to fetch new results?

A few days ago I asked Is there a way to make tail -F beep? Now I want to know if there is any way to use *nix utilities, to beep when a tail -F stops returning new lines for a while! I know, I ...
1
vote
1answer
62 views

Can I use tail with a file both as input and destination?

I have a log file that gets big fast. I tried using tail with this syntax but it didn't work. tail logfile.log -n 100000 > logfile.log The output file is 0 bytes and blank. What am I doing ...
27
votes
1answer
4k views

How to do a `tail -f` of log rotated files?

On a long running system I usually have a terminal with $ tail -f /var/log/kern.log or something like this open. But from time to time I have to restart such command because no new messages are ...
1
vote
0answers
110 views

Pretty tail -f for log files [duplicate]

Possible Duplicate: How to have tail -f show colored output Is there a bash/awk script or utility that pretty formats and colors tail -f from log files? At the moment I am specifically ...
2
votes
3answers
1k views

Is it fine to use tail -f on large log files

I would like monitor a large log file (close to 1 GB) for errors. I want this to be close to real time (few seconds delay is fine). My plan is to use tail -f | grep. Is there any performance issues ...
4
votes
1answer
172 views

What's a convenient way of checking what's being added to a log file in realtime?

Right now I'm essentially executing tail /var/log/syslog manually every once in a while. Is there something that lets me see what's being added continuously, or do I need to write something myself?
12
votes
6answers
4k views

Best way to follow a log and execute a command when some text appears in the log

I have a server log that outputs a specific line of text into its log file when the server is up. I want to execute a command once the server is up, and hence do something like the following: tail -f ...
7
votes
2answers
3k views

Reading from a continuously changing logfile [duplicate]

There is /location/of/thefile, which is a continuously changing logfile. The average density of refreshes is 4 per minute, the possible maximal refresh rate could be 30-40 per minute. Every refresh ...
4
votes
6answers
1k views

Is it possible to “roll” a symlink to a new file without affecting any open file handles?

An application I am developing locally logs it's output to files formatted with the current timestamp such as app-%Y%m%d.log. To make it simple to be able to tail the current's day log in a terminal ...