SOLVED - Error on query for ML Job

Hi,

I am getting the following error on a single job:

Job Validation Error: [parsing_exception] [query_string] unknown token [START_OBJECT] after [query], with { line=1 & col=35 } :: {"path":"/usage-*/_search","query":{"size":0},"body":"{"query":{"query_string":{"query":{"match":{"usage_type.keyword":"IPASS"}}}},"aggs":{"earliest":{"min":{"field":"session_start"}},"latest":{"max":{"field":"session_start"}}}}","statusCode":400,"response":"{"error":{"root_cause":[{"type":"parsing_exception","reason":"[query_string] unknown token [START_OBJECT] after [query]","line":1,"col":35}],"type":"parsing_exception","reason":"[query_string] unknown token [START_OBJECT] after [query]","line":1,"col":35},"status":400}"}

I want to filter on these sessions only and report on them.

The query entered is:
{"query_string":{"query": {"match": {"usage_type.keyword": "IPASS"}}}}

I then tried this: {"query": {"match": {"usage_type.keyword": "IPASS"}}} based on ParsingException[[match] unknown token [START_OBJECT] after [query]] - #3 by varun_kumar2 but that got me a new error:

Job Validation Error: [parsing_exception] no [query] registered for [query], with { line=1 & col=19 } :: {"patah":"/usage-*/_search","query":{"size":0},"body":"{"query":{"query":{"match":{"usage_type.keyword":"IPASS"}}},"aggs":{"earliest":{"min":{"field":"session_start"}},"latest":{"max":{"field":"session_start"}}}}","statusCode":400,"response":"{"error":{"root_cause":[{"type":"parsing_exception","reason":"no [query] registered for [query]","line":1,"col":19}],"type":"parsing_exception","reason":"no [query] registered for [query]","line":1,"col":19},"status":400}"}

I've tried this with different options and unable to get this to work.

Thanks in advance.

Wayne

Fixed it. I tried this (at least i thought I did) - value below fixed it:

{"match": {"usage_type.keyword": "IPASS"}}}

1 Like