09 Aug 2024 08:29 PM - last edited on 01 Oct 2024 09:29 AM by MaciejNeumann
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))