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

DQL table entity tags

AntonPineiro
DynaMight Guru
DynaMight Guru

Hi,

I would like to create a table with tags to an entity, for example, "dt.entity.sql:com_dynatrace_extension_sql-oracle_host".

fetch `dt.entity.sql:com_dynatrace_extension_sql-oracle_host`
| fieldsAdd tags

Before query shows all tags combined as "field1:value,field2:value"... Those value are not ordered and not all rows contains same values.

Any option to adding those tags as as new fields/columns?

Best regards

 

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl
4 REPLIES 4

Hi @AntonPineiro ,

"| expand  tags" will not help here ? but this will add as rows.

 

Consultant | TEKsystems

Hi,

Not because I would like them as columns. It means, from this:

entity.nameidtags
x1id1field1:value, field2:value
x2id2field1:value, field3:value

 

To:

entity.nameidtagsfield1field2field3
x1id1field1:value, field2:valuevaluevaluenull
x2id2field1:value, field3:valuevaluenullvalue

Best regards

 

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

Hi @AntonPineiro 

May be you can try something like this ?

data record(entity.name = "x1", id = "id1", tags = array("field1:A","field2:C")),
     record(entity.name = "x2", id = "id2", tags = array("field1:B","field3:D"))
| expand tags
| parse tags, "ld:key ':' ld:tag_value"
| fieldsAdd key,tag_value
| summarize { Key_value=collectArray(array(toString(key),tag_value)) }, by: {entity.name}
| fieldsAdd Key_value=toString(Key_value)
| parse Key_value, "'[' KVP{ '[' DQS:key ', ' DQS:value ']' ', '?}:key ']'"
| fieldsFlatten key

 you will get a result like this, but not sure this will help you 

Screenshot 2025-04-29 at 12.54.36 PM.png

 

Regards,

Akhil Jayendran

Consultant | TEKsystems

Hi,

This is a super awesome answer!! :take_my_money::take_my_money:

Thank you so much!

Best regards

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

Featured Posts