cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Example of 'in' operator in Segments

kumaravel
Contributor

Hello, 

I have been trying to use the 'in' operator to apply filters in the Segments but always get errors like "The filter field statement has to be defined" or "Segments can only filter by text. Wrap "(t)" with quotation marks."
Is there some working example which I could use as  reference.

Kind Regards,

Kumaravel

Dynatrace Certified Associate
4 REPLIES 4

radek_jasinski
DynaMight Guru
DynaMight Guru

Hi @kumaravel 

Below you can find an example of how to achieve the desired filtering in DQL (since the in operator is not supported in this context) by using multiple OR conditions instead:

fetch logs
| filter dt.system.bucket == "logs_default" OR dt.system.bucket == "logs_archive"
| fields dt.system.bucket, loglevel, content

Have a nice day!

Hello @radek_jasinski ,

Thanks for your reply.

In my case, I do not have a fixed list to hardcode with OR condition and was looking for an option to work with dynamic values.

But if its not supported, then will check other possible ways to implement my usecase.

Is there any plan to include the in operator in the 'Segments' as well or its out of scope for some specific reason?

 

 

Dynatrace Certified Associate

I couldn’t find anything in the documentation saying that in is supported in Segments, and I just tried it myself but it didn’t work either.

https://docs.dynatrace.com/docs/manage/segments/reference/segments-reference-data-types

https://docs.dynatrace.com/docs/manage/segments/reference/segments-reference-limits

 

Have a nice day!

kumaravel
Contributor

When I am trying to build a segment, I saw the link to documentation as shown in screenshot

kumaravel_0-1751897004820.png

The link points to the page https://docs.dynatrace.com/docs/discover-dynatrace/get-started/dynatrace-ui/ui-filter-field

So this is kind of confusing as the documentation link mentions the operator 'in'.

Dynatrace Certified Associate

Featured Posts