<s> from libnmap . parser import NmapParser <EOL> from libnmap . reportjson import ReportDecoder <EOL> from libnmap . plugins . es import NmapElasticsearchPlugin <EOL> from datetime import datetime <EOL> import json <EOL> nmap_report = NmapParser . parse_fromfile ( '<STR_LIT>' ) <EOL> mindex = datetime . fromtimestamp ( nmap_report . started ) . strftime ( '<STR_LIT>' ) <EOL> db = NmapElasticsearchPlugin ( index = mindex ) <EOL> dbid = db . insert ( nmap_report ) <EOL> nmap_json = db . get ( dbid ) <EOL> nmap_obj = json . loads ( json . dumps ( nmap_json ) , cls = ReportDecoder ) <EOL> print ( nmap_obj ) </s>
