Skip to content

Instantly share code, notes, and snippets.

@salekseev
Created August 30, 2016 18:03
Show Gist options
  • Save salekseev/85920f907957f982cfd32a8231d9e964 to your computer and use it in GitHub Desktop.
Save salekseev/85920f907957f982cfd32a8231d9e964 to your computer and use it in GitHub Desktop.
#!/bin/bash
index="epriorauth"
date="2016-08-23"
broker="kafka100"
topic="structured_log_all"
kafkacat -b $broker -t $topic -C -o beginning \
| jq --arg index "$index" --arg date "$date" -cM '{"@timestamp": .["@timestamp"], "@target_index": .["@target_index"]} | select(.["@target_index"]==$index) | select( .["@timestamp"] | startswith($date) )'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment