Skip to content

Instantly share code, notes, and snippets.

@paulocoutinhox
Last active November 26, 2015 16:21
Show Gist options
  • Save paulocoutinhox/187f9905ea578ecd2e6e to your computer and use it in GitHub Desktop.
Save paulocoutinhox/187f9905ea578ecd2e6e to your computer and use it in GitHub Desktop.
Elasticsearch for Logstack for log entries by message, token and type
POST /logstack/log
{
"token": "722278A5-2F08-414B-AC95-563CAAE63598",
"type": "debug",
"message": "ATENÇÃO: A aplicação está com o MODO DEBUG ativado!"
}
POST /logstack/log
{
"token": "722278A5-2F08-414B-AC95-563CAAE63598",
"type": "debug",
"message": "A aplicação está com o MODO LOGOUT LOCAL ONLY desativado!"
}
DELETE /logstack
GET /logstack/_mapping/log
PUT /logstack
{
"mappings" : {
"log" : {
"properties" : {
"token" : {
"type" : "string",
"index" : "not_analyzed"
},
"type" : {
"type" : "string",
"index" : "not_analyzed"
},
"created_at" : {
"type" : "date",
"format" : "yyyy-MM-dd'T'HH:mm:ss",
"null_value": "now"
}
}
}
}
}
POST /logstack/_search
{
"query": {
"bool": {
"must": {
"match": {
"message": "a"
}
},
"filter": [
{
"term": {
"type": "debug"
}
},
{
"term": {
"token": "722278A5-2F08-414B-AC95-563CAAE63598"
}
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment