Hi there,
I want to fetch JSON formatted logs from a URL.
I'm using HTTP_POLLER. Sending it to Elasticsearch output under the name: "json_10meilleurs_logs"
Here's my config file:
input {
http_poller {
urls => {
test => {
method => get
user => "me"
password => "mypassword"
url => "myurl"
headers => {
Accept => "application/json"
}
}
}
request_timeout => 120
schedule => { cron => "*/03 * * * * UTC"}
codec => "json"
metadata_target => "http_poller_metadata"
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "json_10meilleurs_logs"
user => "elastic"
password => "changeme"
}
}
but the answer I get is an error mentioning "http_request_failure":
{
"took": 0,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 1,
"hits": [
{
"_index": "json_10meilleurs_logs",
"_type": "logs",
"_id": "AWBKBGYk-gt4iIR0On40",
"_score": 1,
"_source": {
"http_request_failure": {
"name": "test",
"request": {
"headers": {
"Accept": "application/json"
},
"method": "get",
"auth": {
"eager": true,
"user": "me",
"pass": "mypassword"
},
"url": "myurl"
},
"error": "Read timed out",
"backtrace": null,
"runtime_seconds": 10.289
},
"@timestamp": "2017-12-12T09:18:10.416Z",
"@version": "1",
"http_poller_metadata": {
"name": "test",
"host": "kda-CTBR3G2",
"request": {
"headers": {
"Accept": "application/json"
},
"method": "get",
"auth": {
"eager": true,
"user": "me",
"pass": "mypassword"
},
"url": "myurl"
},
"runtime_seconds": null
},
"tags": [
"_http_request_failure"
]
}
}
]
}
}
Could anyone help please? I'm stuck on this for a while