My request
I am writing an Elasticsearch request and specifying the requested index
in the URL and the request in an external JSON file:
curl
curl -s \
-u $user:$pass \
https://example.com:9243/index_name/search
-d @query.json
query.json
{
"size": 5,
"from": 0,
"sort": [
{
"@timestamp": {
"order": "desc",
"unmapped_type": "boolean"
}
}
],
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "source:*.log",
"analyze_wildcard": true
}
}
]
}
},
"_source": {
"include": ["message", "@timestamp"],
"exclude": "_*"
}
}
My problem
I would like to specify the index name in the query file, not the URL.
What i tried
My question
What is the correct way to specify an index in
source
share