Skip to content

Instantly share code, notes, and snippets.

@kosho
Created April 11, 2017 01:40
Show Gist options
  • Save kosho/35f8871ea5b0480fb25d08c80637ecce to your computer and use it in GitHub Desktop.
Save kosho/35f8871ea5b0480fb25d08c80637ecce to your computer and use it in GitHub Desktop.
tail -n +2 %1 | awk 'BEGIN{FS = ","}{print "{\"index\": { }}\n{ \"@timestamp\" : \""$1"\", \"field2\": \""$2"\", \"field3\":" $3 "}" }' > %2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment