KQL : query_string doesn't work

Hi there:
Interestingly, I'm not sure why the below "query_string" doesn't returns any hits but it returns hits on 'Discovery UI's Filters section. Please advise, thanks

"sql_string" - This doesn't return any hits

GET system-metric*/_search
{
  "query" : {
     "query_string": {
          "query: "type:metricsets AND system.filesystem.used.pct: >0.8"
     }
  }
}

Discovery UI - Filters section where you can enter KQL - This returned hits

 system.filesystem.used.pct >0.8

KQL only works within Kibana, the query_string query is a different beast. Specifying ranges with the query string query is explained here: Query string query | Elasticsearch Guide [7.13] | Elastic

Hope that helps!

2 Likes

Yay..it's working with ranges. I'm so happy now, thanks for your helps, Alex.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.