Skip to content

Commit

Permalink
Merge pull request #52 from fitzyjoe/another-jq-example
Browse files Browse the repository at this point in the history
Another jq example
  • Loading branch information
rusq authored Apr 22, 2022
2 parents c2ce2d2 + f1686f5 commit efcb7a4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/jq/find_matches_print_dates_and_text.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

SAMPLE=../sample.json

cat "${SAMPLE}" | jq '.messages[] | select(( .text != null) and (.text | test("JoInEd";"i"))) | (.ts |= (tonumber|todate)) | .ts, .text' | tr -d '"'
5 changes: 5 additions & 0 deletions examples/jq/print_messages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

SAMPLE=../sample.json

cat "${SAMPLE}" | jq '.messages[]|.user +": "+.text' | tr -d '"'

0 comments on commit efcb7a4

Please sign in to comment.