Returning a new constant field in a subquery



  • Official comment
    Matt Sullivan

    assuming you want to just show results from category1 where Id from category 2 is present, you might opt to move the subquery to the scoping portion of the query, and presuming category1 does not have a field named singleId, you must use the keywords modifier on the subquery. Net result is something like below

    | parse "Id * " as singleId
    | compose singleId keywords]

    Comment actions Permalink
  • Avatar
    Alex Kanjirakattu Jose

    Im facing the same problem where a subquery within a where clause is not returning the field I want

    //Base Query 

    | where (value_from_base_query/[subquery from=(-15m):(scoping for subquery ) | timeslice 15m
    | count as transaction_count by _timeslice | compare with timeshift 7d 4 avg as AVG|sum(transaction_count_AVG) as AVERAGE|compose AVERAGE ] )<50


    Returns --> "Subquery failed with error: Field AVERAGE not found, please check the spelling and try again." 


    How does subquery work with where /if ?

    Comment actions Permalink

Please sign in to leave a comment.