Returning a new constant field in a subquery

Comments

2 comments

  • Official comment
    Avatar
    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

    _sourceCategory=category1
    [subquery:_sourceCategory=category2
    | 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 ?

    0
    Comment actions Permalink

Please sign in to leave a comment.