Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json parse is wrong for pmacct #17

Open
paolss opened this issue Dec 19, 2022 · 0 comments
Open

json parse is wrong for pmacct #17

paolss opened this issue Dec 19, 2022 · 0 comments

Comments

@paolss
Copy link

paolss commented Dec 19, 2022

example:
/home/pstaszewski/pmacct-to-elasticsearch# pmacct -l -p /tmp/epix_mem.pipe -s -O json -e | pmacct-to-elasticsearch e_mem
2022-12-20 00:18:56,105 ERROR Error loading configuration from /etc/p2es/epix_mem.conf
Traceback (most recent call last):
File "/usr/local/bin/pmacct-to-elasticsearch", line 398, in main
new_cfg = json.load(f)
File "/usr/lib/python3.8/json/init.py", line 293, in load
return loads(fp.read(),
File "/usr/lib/python3.8/json/init.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.8/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 4 column 1 (char 69)

Or for json
/usr/local/bin/pmacct-to-elasticsearch e_print
2022-12-20 00:26:46,363 ERROR Error loading configuration from /etc/p2es/epix_print.conf
Traceback (most recent call last):
File "/usr/local/bin/pmacct-to-elasticsearch", line 398, in main
new_cfg = json.load(f)
File "/usr/lib/python3.8/json/init.py", line 293, in load
return loads(fp.read(),
File "/usr/lib/python3.8/json/init.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.8/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 4 column 5 (char 73)

And sfacctd config
! Elastic
aggregate[e_mem]: peer_src_ip, vlan, src_as, dst_as, in_iface, out_iface, src_net, dst_net, src_mask, dst_mask, flows
imt_path[e_mem]: /tmp/e_mem.pipe
aggregate[e_print]: peer_src_ip, vlan, src_as, dst_as, in_iface, out_iface, src_net, dst_net, src_mask, dst_mask, flows
print_output_file[e_print]: /data/e_print.json
print_output[e_print]: json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant