All of lore.kernel.org
 help / color / mirror / Atom feed
* [ULOGD2] Timestamp without year in logemu
@ 2017-01-03 19:28 Petteri Matilainen
  2017-01-03 20:58 ` Eric Leblond
  0 siblings, 1 reply; 3+ messages in thread
From: Petteri Matilainen @ 2017-01-03 19:28 UTC (permalink / raw)
  To: netfilter

Hello list,

I'm using iptables firewall and I'm logging blocked packets with NFLOG 
target and ULOGD2. I have the following configuration in ulogd.conf:

# this is a stack for logging packets to firewall.log after a collect 
via NFLOG
stack=firewall6:NFLOG,base6:BASE,ifi6:IFINDEX,ip2str6:IP2STR,print6:PRINTPKT,logemu6:LOGEMU

[logemu6]
file="/var/log/firewall.log"
sync=1

The logging itself works just fine, but I noticed the timestamps are 
missing the year, like so:

Apr 23 10:38:04 Router In_New_TCP IN=eth0 OUT=...

Any ideas why? This causes problems with the system I'm using to graph 
the logs and make statistics. My system is Debian with kernel 3.16.7. 
Ulogd version is 2.0.4. I found an online manual for ulogd2 which 
mentioned a LOCAL filter but my ulogd does not recognize it.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ULOGD2] Timestamp without year in logemu
  2017-01-03 19:28 [ULOGD2] Timestamp without year in logemu Petteri Matilainen
@ 2017-01-03 20:58 ` Eric Leblond
  2017-01-04  5:37   ` Petteri Matilainen
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Leblond @ 2017-01-03 20:58 UTC (permalink / raw)
  To: Petteri Matilainen, netfilter

Hello,

On Tue, 2017-01-03 at 21:28 +0200, Petteri Matilainen wrote:
> Hello list,
> 
> I'm using iptables firewall and I'm logging blocked packets with
> NFLOG 
> target and ULOGD2. I have the following configuration in ulogd.conf:
> 
> # this is a stack for logging packets to firewall.log after a
> collect 
> via NFLOG
> stack=firewall6:NFLOG,base6:BASE,ifi6:IFINDEX,ip2str6:IP2STR,print6:P
> RINTPKT,logemu6:LOGEMU
> 
> [logemu6]
> file="/var/log/firewall.log"
> sync=1
> 
> The logging itself works just fine, but I noticed the timestamps are 
> missing the year, like so:
> 
> Apr 23 10:38:04 Router In_New_TCP IN=eth0 OUT=...
> 
> Any ideas why? This causes problems with the system I'm using to
> graph 
> the logs and make statistics. My system is Debian with kernel
> 3.16.7. 
> Ulogd version is 2.0.4. I found an online manual for ulogd2 which 
> mentioned a LOCAL filter but my ulogd does not recognize it.

I've just checked the code and it is using (since 2006) ctime which
does not return the year.

It may not work for you but if you use the JSON output, you will get
something nicely formated and will get the year.

BR,
-- 
Eric Leblond <eric@regit.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ULOGD2] Timestamp without year in logemu
  2017-01-03 20:58 ` Eric Leblond
@ 2017-01-04  5:37   ` Petteri Matilainen
  0 siblings, 0 replies; 3+ messages in thread
From: Petteri Matilainen @ 2017-01-04  5:37 UTC (permalink / raw)
  To: netfilter

Hello Eric,

Thanks for the reply. Would it be possible to modify the code to
include year in logemu output? I mean, is it something that is easily
modified locally just for me? Can you explain the LOCAL filter, why is
it not there anymore? It's description says that it may print more
accurate timestamp.

Also, if anyone else has tips on how to get the year included in the
log lines, maybe do a search and replace afterwards or something
(although it would be very heavy on large logs), please share.

regards

Petteri Matilainen


On Tue, Jan 3, 2017 at 10:58 PM, Eric Leblond <eric@regit.org> wrote:
> Hello,
>
> On Tue, 2017-01-03 at 21:28 +0200, Petteri Matilainen wrote:
>> Hello list,
>>
>> I'm using iptables firewall and I'm logging blocked packets with
>> NFLOG
>> target and ULOGD2. I have the following configuration in ulogd.conf:
>>
>> # this is a stack for logging packets to firewall.log after a
>> collect
>> via NFLOG
>> stack=firewall6:NFLOG,base6:BASE,ifi6:IFINDEX,ip2str6:IP2STR,print6:P
>> RINTPKT,logemu6:LOGEMU
>>
>> [logemu6]
>> file="/var/log/firewall.log"
>> sync=1
>>
>> The logging itself works just fine, but I noticed the timestamps are
>> missing the year, like so:
>>
>> Apr 23 10:38:04 Router In_New_TCP IN=eth0 OUT=...
>>
>> Any ideas why? This causes problems with the system I'm using to
>> graph
>> the logs and make statistics. My system is Debian with kernel
>> 3.16.7.
>> Ulogd version is 2.0.4. I found an online manual for ulogd2 which
>> mentioned a LOCAL filter but my ulogd does not recognize it.
>
> I've just checked the code and it is using (since 2006) ctime which
> does not return the year.
>
> It may not work for you but if you use the JSON output, you will get
> something nicely formated and will get the year.
>
> BR,
> --
> Eric Leblond <eric@regit.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-04  5:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-03 19:28 [ULOGD2] Timestamp without year in logemu Petteri Matilainen
2017-01-03 20:58 ` Eric Leblond
2017-01-04  5:37   ` Petteri Matilainen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.