Skip to content

Instantly share code, notes, and snippets.

@dennisoelkers
Created June 5, 2024 15:41
Show Gist options
  • Save dennisoelkers/c77c91f3756dbec08f5430d8bdd0960b to your computer and use it in GitHub Desktop.
Save dennisoelkers/c77c91f3756dbec08f5430d8bdd0960b to your computer and use it in GitHub Desktop.
#!/bin/sh
curl -X PUT "http://localhost:9200/graylog_0" -H "Content-Type: application/json" -d'{ "mappings": { "properties": { "timestamp": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss.SSS"
},
"http_method": { "type": "keyword" }
}
}
}'
jq -c '.documents[].document[] | select(.data != null) | .data' random-http-logs.json|while read -r data; do curl -XPOST -H 'Content-Type: application/json' -d "$data" http://localhost:9200/graylog_0/_doc; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment