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

use json output for nfdump data files #207

Open
philhagen opened this issue Mar 26, 2021 · 1 comment
Open

use json output for nfdump data files #207

philhagen opened this issue Mar 26, 2021 · 1 comment
Assignees

Comments

@philhagen
Copy link
Owner

The JSON output mode for nfdump should provide a better (faster?) and more streamlined processing pipeline than CSV. Some sample records are below. One potential optimization that would be useful would be an "ndjson" output mode, with one record per line and no enclosing [] list structure. This can be handled in post-processing, but it would be cleaner and probably more manageable for large data sets if it were native. I might submit a PR to nfdump to add this.

[
{
    "type" : "FLOW",
    "sampled" : 0,
    "export_sysid" : 1,
    "t_first" : "2021-03-22T19:19:45.148",
    "t_last" : "2021-03-22T19:20:17.420",
    "proto" : 6,
    "src4_addr" : "192.168.1.170",
    "dst4_addr" : "192.168.3.161",
    "src_port" : 49911,
    "dst_port" : 9200,
    "fwd_status" : 0,
    "tcp_flags" : "........",
    "src_tos" : 0,
    "in_packets" : 3,
    "in_bytes" : 204,
    "connect_id" : "0",
    "event_id" : "0",
    "event" : "IGNORE",
    "xevent_id" : "0",
    "sgt_id" : "101",
    "t_event" : "1970-01-01T00:00:00.0",
    "label" : "<none>"
}
,
{
    "type" : "FLOW",
    "sampled" : 0,
    "export_sysid" : 1,
    "t_first" : "2021-03-22T18:35:56.12",
    "t_last" : "2021-03-22T19:20:42.320",
    "proto" : 6,
    "src4_addr" : "192.168.1.170",
    "dst4_addr" : "192.168.0.140",
    "src_port" : 88,
    "dst_port" : 378,
    "fwd_status" : 0,
    "tcp_flags" : "........",
    "src_tos" : 0,
    "in_packets" : 60911,
    "in_bytes" : 5654215,
    "connect_id" : "0",
    "event_id" : "0",
    "event" : "IGNORE",
    "xevent_id" : "0",
    "sgt_id" : "101",
    "t_event" : "1970-01-01T00:00:00.0",
    "label" : "<none>"
}
]
@philhagen philhagen self-assigned this Mar 26, 2021
@philhagen
Copy link
Owner Author

H/T to Raul P for the question that spurred this and the sample to prove it's viable.

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