I m using Nginx as a proxy to my website, I've configured Logstash to parse Nginx log files and save them to Elasticsearch... Now I want to analyse those data.
I need a query to get number of visits of visits of a specific route, like http://company/company_name and /joboffer/job_offer_title
nginx Logs are stored like this in Elasticsearch:
referrer: url of the resource
verb: HTTP method like GET, POST, ...
{
"_index": "logstash-2016.07.27",
"_type": "nginx-access",
"_id": "AVZMOZHNl8SqLoCNz3nb",
"_score": 1,
"_source": {
"message": "172.18.0.1 - - [27/Jul/2016:14:39:29 +0000] \"GET /favicon.ico HTTP/1.1\" 404 24 \"http://jobi.dev/\" \"-\" \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36\" \"-\"",
"@version": "1",
"@timestamp": "2016-07-27T14:39:29.000Z",
"path": "/tunlogia/nginx/access.log",
"host": "fa6cdfd75875",
"type": "nginx-access",
"clientip": "172.18.0.1",
"ident": "-",
"auth": "-",
"verb": "GET",
"request": "/favicon.ico",
"httpversion": "1.1",
"response": 404,
"bytes": 24,
"referrer": "\"http://jobi.dev/\"",
"x_alt_referrer": "\"-\"",
"agent": "\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36\"",
"extra_fields": " \"-\"",
"name": "Chrome",
"os": "Linux",
"os_name": "Linux",
"device": "Other",
"major": "52",
"minor": "0",
"patch": "2743"
}
}
My question is how can I get the number of visits of a specific route having 'GET
' as a verb