If you want to create an AS-filtered database with a combination of multiple of ASes, follow the instructions below.
Here I am downloading the IP to ASN database.
curl -L https://ipinfo.io/data/free/asn.csv.gz?token=<YOUR_TOKEN> -o asn.csv.gz
I am using the CLI utility
gunzip, but you can use whatever compression software or tool you want to use.
asns.txt file that contains your desired ASNs. For example:
AS36473 AS12054 AS207137
grep like before, we will create the filtered database. However, we are going to use the
-f option, which stands for “fixed strings” and pass our
asns.txt file containing the selected ASNs.
(head -1 asn.csv;grep -f asns.txt asn.csv) > filtered_asns.csv
You can skip the uncompressing step and run grep on the compressed file with
zgrep. Here I am running the grep on the compressed
asn.csv.gz database and viewing it one
zgrep -f asns.txt asn.csv | less