Skip to content

Instantly share code, notes, and snippets.

@shinaisan
Created September 2, 2018 04:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shinaisan/cf37111d279ad89ce6cf4e9d7288a3ce to your computer and use it in GitHub Desktop.
Save shinaisan/cf37111d279ad89ce6cf4e9d7288a3ce to your computer and use it in GitHub Desktop.
Minimal Example of Logstash HTTP Input

Minimal Example of Logstash HTTP Input

Logstash

pushd $THIS_GIST_DIR
test -d data || mkdir data
test -d logs || mkdir logs
logstash --path.settings $THIS_GIST_DIR --path.logs $THIS_GIST_DIR/logs --path.data $THIS_GIST_DIR/data -f $THIS_GIST_DIR/pipeline.config

curl

curl -H 'Content-Type: application/json' -XPUT http://localhost:8888/test -d '
{ "rss": 30269440,
  "heapTotal": 7708672,
  "heapUsed": 4962840,
  "external": 8735 }'
curl -H 'Content-Type: application/json' -XPUT http://localhost:8888/test -d '
{ "message" : {
  "rss": 30269440,
  "heapTotal": 7708672,
  "heapUsed": 4962840,
  "external": 8735 } }'
input {
http {
codec => "json"
host => "localhost"
port => "8888"
}
}
output {
stdout { codec => rubydebug }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment