Advertisement
rgruber

rir-asns, rir-prefixes

Jun 5th, 2022
1,462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.46 KB | None | 0 0
  1. SELECT asn,SUBSTRING_INDEX(k,':',-1)cc INTO outfile '/tmp/rir-asns.txt' from bh_cache,json_table(jdoc, '$.resources.asn[*]' columns (asn int path '$')) r where k like 'country-resource-list:%' ORDER BY asn;
  2. SELECT prefix,SUBSTRING_INDEX(k,':',-1)cc INTO outfile '/tmp/rir-prefixes.txt' from bh_cache,json_table(jdoc, '$.resources.ipv4[*]' columns (prefix VARCHAR(255) path '$')) r where k like 'country-resource-list:%' ORDER BY inet_aton(REGEXP_SUBSTR(prefix,'[0-9]+'));
  3.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement