Re: [pmacct-discussion] Using large hex values for "label" in pre_tag_map results in strange SQL

2020-02-13 Thread Paolo Lucente


Hey Tim,

It should be that the issue you described in the previous email and this
one are connected. And it should be that i pin-pointed to a common root
cause addressed by this commit:

https://github.com/pmacct/pmacct/commit/4e648cc96aae99ee5f4b1c9e135a1afa73b864b3

Which, in turn, is connected to some recent work that was done on
labels. Can you give this a try (latest code or apply the patch to the
code you are running) and let me know if this works for you?

Paolo

On Wed, Feb 12, 2020 at 05:56:35PM -0600, Tim Jackson wrote:
> I'm using some large hex values as the set_label in our pre_tag_map and
> getting some weird behavior..
> 
> example map:
> 
> https://paste.somuch.fail/?bafc96e84fe95322#j6T+54l/gxN90POeMi3yuhBT9XOPMmEqt3IF5cvHOJk=
> 
> When using this w/ pgsql as the output plugin, I see some errors randomly
> from postgres (I have dont_try_update+use_copy on):
> 
> 2020-02-12 23:49:41.148 UTC [11632] postgres@sfacctd ERROR:  invalid byte
> sequence for encoding "UTF8": 0xc0 0x2c
> 2020-02-12 23:49:41.148 UTC [11632] postgres@sfacctd CONTEXT:  COPY
> acct_v9, line 1
> 2020-02-12 23:49:41.148 UTC [11632] postgres@sfacctd STATEMENT:  COPY
> acct_v9 (mac_src, mac_dst, vlan, ip_src, ip_dst, as_src, iface_in,
> iface_out, as_dst, comms, peer_ip_src, port_src, port_dst, tos, ip_proto,
> sampling_rate, timestamp_arrival, tag, tag2, label, packets, bytes) FROM
> STDIN DELIMITER ','
> 
> I'm also seeing when doing some debugging some strange rows being generated
> where the label field is longer than any label I have set in the
> pre_tag_map file itself:
> 
> DEBUG ( all/pgsql ):
> ff:ff:fb:f9:b6:c4,ff:ff:ff:a1:8c:2b,0,1.1.1.1,2.2.2.2,0,547,607,30419,,1.1.1.1,23836,2,6,1024,2020-02-12
> 23:50:21,0,1,c7515ed894354725bc60160ee48775ce0e3b3924fb730,1,307
> 
> Any ideas where that could be coming from?
> 
> --
> Tim

> ___
> pmacct-discussion mailing list
> http://www.pmacct.net/#mailinglists


___
pmacct-discussion mailing list
http://www.pmacct.net/#mailinglists


[pmacct-discussion] Using large hex values for "label" in pre_tag_map results in strange SQL

2020-02-12 Thread Tim Jackson
I'm using some large hex values as the set_label in our pre_tag_map and
getting some weird behavior..

example map:

https://paste.somuch.fail/?bafc96e84fe95322#j6T+54l/gxN90POeMi3yuhBT9XOPMmEqt3IF5cvHOJk=

When using this w/ pgsql as the output plugin, I see some errors randomly
from postgres (I have dont_try_update+use_copy on):

2020-02-12 23:49:41.148 UTC [11632] postgres@sfacctd ERROR:  invalid byte
sequence for encoding "UTF8": 0xc0 0x2c
2020-02-12 23:49:41.148 UTC [11632] postgres@sfacctd CONTEXT:  COPY
acct_v9, line 1
2020-02-12 23:49:41.148 UTC [11632] postgres@sfacctd STATEMENT:  COPY
acct_v9 (mac_src, mac_dst, vlan, ip_src, ip_dst, as_src, iface_in,
iface_out, as_dst, comms, peer_ip_src, port_src, port_dst, tos, ip_proto,
sampling_rate, timestamp_arrival, tag, tag2, label, packets, bytes) FROM
STDIN DELIMITER ','

I'm also seeing when doing some debugging some strange rows being generated
where the label field is longer than any label I have set in the
pre_tag_map file itself:

DEBUG ( all/pgsql ):
ff:ff:fb:f9:b6:c4,ff:ff:ff:a1:8c:2b,0,1.1.1.1,2.2.2.2,0,547,607,30419,,1.1.1.1,23836,2,6,1024,2020-02-12
23:50:21,0,1,c7515ed894354725bc60160ee48775ce0e3b3924fb730,1,307

Any ideas where that could be coming from?

--
Tim
___
pmacct-discussion mailing list
http://www.pmacct.net/#mailinglists