That is what i do use, if you look at first code.
Script do work fine for all January (two digit date), and stopped 1 February. I did make it some weeks ago.
Log file is growing with several lines every minutes, so I know data is there, but can not get any data for February. (gives no output)
Ubuntu 10.10
You cannot compare 'dates' in the form of: Feb 1 18:00:11 - regardless of the extra space. You're comparing strings, which makes no sense.
You need to convert both values ($0 and to/from) to integers and compare integer values:
Thanks, but how to get it all into awk.
Strange is that it has worked in January if you say it should not work.
I do use the log to et value for munin to graph it, so I do have nice graphs until 1 feb.
It "worked" because compared strings within 1 month (January).
When the month rolled into February, the string comparison doesn't work any more, because 'Feb' comes before 'Jan' alphabetically.
Feb 1 22:07:53 server2 snmpd[800]: Connection from UDP: [10.10.10.32]:50618->[10.10.10.33]
Feb 1 22:07:53 server2 snmpd[800]: last message repeated 8 times
Feb 1 22:07:57 server2 snmpd[800]: Connection from UDP: [10.10.10.32]:50618->[10.10.10.33]
Feb 1 22:07:57 server2 snmpd[800]: last message repeated 92 times
Feb 1 22:08:13 server2 snmpd[800]: Connection from UDP: [10.10.10.32]:50618->[10.10.10.33]
Feb 1 22:08:13 server2 snmpd[800]: last message repeated 2 times
Feb 1 22:08:13 server2 snmpd[800]: Connection from UDP: [10.10.10.32]:50618->[10.10.10.33]
Feb 1 22:08:25 server2 snmpd[800]: Connection from UDP: [10.10.10.32]:50618->[10.10.10.33]
Feb 1 22:08:25 server2 snmpd[800]: last message repeated 6 times
Feb 1 22:09:05 server2 snmpd[800]: Connection from UDP: [10.10.10.32]:50618->[10.10.10.33]
Feb 1 22:09:35 server2 snmpd[800]: Connection from UDP: [10.10.10.32]:50618->[10.10.10.33]
Feb 1 22:09:57 server2 snmpd[800]: Connection from UDP: [10.10.10.32]:50618->[10.10.10.33]
Feb 1 22:10:13 server2 snmpd[800]: Connection from UDP: [10.10.10.32]:50618->[10.10.10.33]
Feb 1 22:10:13 server2 snmpd[800]: last message repeated 3 times
Feb 1 22:10:43 server2 snmpd[800]: Connection from UDP: [10.10.10.32]:50618->[10.10.10.33]
Feb 1 22:10:43 server2 snmpd[800]: last message repeated 5 times
Feb 1 22:11:05 server2 snmpd[800]: Connection from UDP: [10.10.10.32]:50618->[10.10.10.33]
Feb 1 22:11:35 server2 snmpd[800]: Connection from UDP: [10.10.10.32]:50618->[10.10.10.33]
Feb 1 22:11:57 server2 snmpd[800]: Connection from UDP: [10.10.10.32]:50618->[10.10.10.33]
My goal is to get only some time specific part of the log. Eks. last 24 hours