Skip to content

Commit

Permalink
Add a simple jq script to parse A record answers from ndjson output
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Greene committed Apr 29, 2020
1 parent 04286db commit 0fc9d3c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/massdnsA.jq
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#
# $ jq -r -f massdnsA.jq < results.json
# www.xxxxxxxx.com 1.2.3.4
# www.xxxxxxxx.com 1.2.3.4
# www.yyyyyy.com 3.4.5.6
# www.zzzzzz.com 4.5.6.7
#
# Easy to modify for AAAA and other record types
#
. |
select(
.class == "IN" and
.status == "NOERROR") |
(.name|rtrimstr(".")) + "," + (.data.answers[] | select(.type == "A") .data)?
(.name|rtrimstr(".")) + " " + (.data.answers[] | select(.type == "A") .data)?

0 comments on commit 0fc9d3c

Please sign in to comment.