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

Filtering entity based on two tags variable in dashboard

susmita_k
Guide

I am trying to get a list of Oracle db instances based on two tags ( Environment and Department, those are also variable). The list will be also a variable in the dashboard. I am trying like this, but its not working for me.

Any help is really appreciated.

 

fetch `dt.entity.sql:com_dynatrace_extension_sql-oracle_instance`
| lookup [fetch `dt.entity.sql:com_dynatrace_extension_sql-oracle_instance`], sourceField:`dt.entity.sql:com_dynatrace_extension_sql-oracle_instance`, lookupField:id, fields:{tags}
| filter isNotNull(tags)
| expand tags
| parse tags, """((LD:tag (!<<'\\' ':') LD:value)|LD:tag)"""
| fieldsAdd tag = replaceString(tag,"""\:""", ":"), value = replaceString(value, """\:""", ":")
| fieldsAdd Dept = if(tag == "Department", value)
| fieldsAdd Env = if(tag == "Environment", value)
| summarize {entity.name = takeAny(entity.name),
Dept=arrayMin(collectArray(Dept)),
Env = arrayMin(collectArray(Env))}
, by:{`dt.entity.sql:com_dynatrace_extension_sql-oracle_instance`}
| filter in(Dept, array($Department)) and
in(Env, array($Environment))

0 REPLIES 0

Featured Posts