diff options
author | aouinizied <aouinizied@gmail.com> | 2020-09-14 16:42:33 +0200 |
---|---|---|
committer | aouinizied <aouinizied@gmail.com> | 2020-09-14 16:42:33 +0200 |
commit | 4cc4efa2289ab328c5697874a2c76db08cd286ed (patch) | |
tree | 0584fe97f565e779242f52b3c6401e68bb506b7c /python | |
parent | ad8318e247dff18086afd81a92e527f876a3c0cb (diff) |
Update example.
Diffstat (limited to 'python')
-rw-r--r-- | python/flow_printer.py | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/python/flow_printer.py b/python/flow_printer.py index 0b533a898..5579694fa 100644 --- a/python/flow_printer.py +++ b/python/flow_printer.py @@ -2,27 +2,26 @@ # -*- coding: utf-8 -*- """ -file: flow_printer.py -This file is part of nfstream. - -Copyright (C) 2019-20 - Zied Aouini <aouinizied@gmail.com> - -nfstream is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License -as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - -nfstream is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty -of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along with nfstream. +------------------------------------------------------------------------------------------------------------------------ +flow_printer.py +Copyright (C) 2019-20 - NFStream Developers +This file is part of NFStream, a Flexible Network Data Analysis Framework (https://www.nfstream.org/). +NFStream is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later +version. +NFStream is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty +of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. +You should have received a copy of the GNU Lesser General Public License along with NFStream. If not, see <http://www.gnu.org/licenses/>. +------------------------------------------------------------------------------------------------------------------------ """ from nfstream import NFStreamer import sys - +# Example must run with nfstream >= 6.1.1 path = sys.argv[1] -flow_streamer = NFStreamer(source=path, statistics=True) +flow_streamer = NFStreamer(source=path, statistical_analysis=False, performance_report=1) result = {} try: for flow in flow_streamer: @@ -31,9 +30,9 @@ try: result[flow.application_name] += flow.bidirectional_packets except KeyError: result[flow.application_name] = flow.bidirectional_packets - print("Summary (Application Name: Packets):") + print("\nSummary (Application Name: Packets):") print(result) except KeyboardInterrupt: - print("Summary (Application Name: Packets):") + print("\nSummary (Application Name: Packets):") print(result) print("Terminated.") |