-
-
Save dennisoelkers/c77c91f3756dbec08f5430d8bdd0960b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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