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

Output in BGP-dump format #46

Open
Tf-arch opened this issue Nov 30, 2021 · 4 comments
Open

Output in BGP-dump format #46

Tf-arch opened this issue Nov 30, 2021 · 4 comments

Comments

@Tf-arch
Copy link

Tf-arch commented Nov 30, 2021

I am getting data from the below code. Could you please tell me how can I get data from pybgpstream in exactly bgpdump format

import pybgpstream
stream = pybgpstream.BGPStream(
from_time="2017-07-07 00:00:00", until_time="2017-07-07 00:10:00 UTC",
collectors=[ "rrc12"],
record_type="updates",
filter="community *:3400"
)

for dump in stream:
# record fields can be accessed directly from elem
# e.g. elem.time
# or via elem.record
# e.g. elem.record.time
print( dump)

output
update|A|1499386168.000000|ris|rrc12|None|None|2914|80.81.192.46|122.162.240.0/20|80.81.192.46|2914 9498 24560 24560|65500:7018 65500:3257 2914:410 65500:3356 65500:6762 2914:2406 2914:3400 65500:174 65500:3549 65500:7473 65500:3491 2914:1405 65500:1299|None|None

I wanna get output like
BGP4MP|1635316051|A|80.33.33.99|14061|185.25.9.1/32|14061 31500 199624 49058|IGP|80.81.193.66|0|0|333:777 6666:888|NAG||

@ACodingfreak
Copy link

I have similar issue as the current output format is missing the key BGP details unlike BGP-dump format.

@alistairking
Copy link
Member

Which key BGP details are you missing?

If you're using bgpreader you can use the -m option to get bgpdump-style output (https://bgpstream.caida.org/docs/tools/bgpreader)
If you want this format from pybgpstream then a PR would be gladly welcomed.

@ACodingfreak
Copy link

Hi @alistairking

Yes I am looking for this option in pybgpstream.

@ACodingfreak
Copy link

@alistairking

I never tried creating python api for C library.
Any reference pointers or examples which can be helpful in creating the PR where I can extend the elem to carry more information.

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

3 participants