Hi there,
I upgraded to 6.1.0 - coming from 5.1.2.
My script was running fine on 5.1.2 but I have problems with using scripted curl with 6.1.0. Maybe there is sth. wrong on my dev environment. Haven't reverted to 5.1.2. for proving that anything works there.
ok, here is my script:
#!/bin/bash
#setting some vars
curlArguments="-XGET http://localhost:9200/*/_search -H \"Content-Type: application/json\""
curlDataFile=./probe.curl
# building the command
mycommand="curl $curlArguments --data \"@$curlDataFile\""
# output of command
echo command is:
echo $mycommand
echo
echo "now firing command"
# firing the command
$mycommand
This is the content of the probe.curl file
{
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "*",
"analyze_wildcard": true
}
},
{
"range": {
"@timestamp": {
"gte": "now/m-5m",
"lte": "now/m",
"format": "epoch_millis"
}
}
}
],
"must_not": []
}
},
"size": "0"
}
When running, I got following output with error message:
command is:
curl -XGET http://localhost:9200/*/_search -H "Content-Type: application/json" --data "@./probe.curl"now firing command
{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}curl: (6) Could not resolve host: application; Der Name oder der Dienst ist nicht bekannt
The strange thing is, when I take the built command line
curl -XGET http://localhost:9200/*/_search -H "Content-Type: application/json" --data "@./probe.curl"
and run it directly from shell it works fine and I get following output:
{"took":14,"timed_out":false,"_shards":{"total":129,"successful":129,"skipped":128,"failed":0},"hits":{"total":78,"max_score":0.0,"hits":[]}}
Can anyone point to the root cause? I don't understand it.
Elasticsearch log is not showing anything, either on good or bad run.