I am trying to export aggregared data out of Elasticsearch using log stash input. Below is my code. But I am getting a error. Can anyone help me?
My code in Logstash.conf
input {
elasticsearch {
hosts => "localhost"
index => "ipfix-5min-20170512"
type =>"agg"
query => '
{
"query": { "match": { "dstPt": "53"} },
"aggs": { "sum_by_hr": { "date_histogram": { "field": "flStDttmUtc", "interval": "1h", "time_zone": "America/New_York", "min_doc_count": 1 } } }
}'
size => 500
scroll => "5m"
docinfo => true
}
}
output {
elasticsearch {
index => "ipfix-5min-20170512_1hr"
document_id => "%{[@metadata][_id]}"
}
}
Error :
Error: [400] {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Failed to parse request body"}],"type":"illegal_argument_exception","reason":"Failed to parse request body","caused_by":{"type":"json_parse_exception","reason":"Unrecognized token 'DnF1ZXJ5VGhlbkZldGNoBQAAAAAAAArsFm5KTF9hcy1TUUgtd3dnbjBPUzl0QkEAAAAAAAA': was expecting ('true', 'false' or 'null')\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@1a9cfbc1; line: 1, column: 73]"}},"status":400}