Skip to content

Commit

Permalink
read: include IP in JSON output
Browse files Browse the repository at this point in the history
This is already the case for CSV and TSV.
  • Loading branch information
max-ipinfo committed Sep 25, 2024
1 parent 03fb810 commit 508bba1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/cmd_read.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ func CmdRead(f CmdReadFlags, args []string, printHelp func()) error {
}
continue
}

if f.Format == "json-compact" || f.Format == "json-pretty" {
record["ip"] = ip
}

recordStr := mapInterfaceToStr(record)

if !hdrWritten {
Expand Down

0 comments on commit 508bba1

Please # to comment.