我正在努力为 Elastic Search 制定正确的 API 搜索调用,该调用将在过去 1 小时内询问我想要的 ipv4address。
第一次尝试:
curl -X GET "localhost:9200/ipaddresses/_search" -H 'Content-Type: application/json' -d'
{
"query": {
"match": {
"ipv4address": {
"query": "50.167.71.25"
}
}
},
"range": {
"@timestamp": {
"gte": "now-1h",
"lt": "now"
}
}
}
'
Run Code Online (Sandbox Code Playgroud)
{"error":{"root_cause":[{"type":"parsing_exception","reason":"[range] 中 START_OBJECT 的未知键。","line":10,"col":12}] ,"type":"parsing_exception","reason":"[range] 中 START_OBJECT 的未知键。","line":10,"col":12},"status":400}
第二次尝试:
curl -X GET "localhost:9200/ipaddresses/_search" -H 'Content-Type: application/json' -d'
{
"query": {
"match": {
"ipv4address": {
"query": "50.167.71.25"
}
}
},
"fields": {
"range": {
"@timestamp": {
"gte": "now-1h",
"lt": …Run Code Online (Sandbox Code Playgroud)