31 Dec 2024 10:30 AM
Hello,
Last day of the year question/puzzle....
When showing tags from a host, an array is retuned.
I want to extract the contents of a specific tag.
So my thought was to convert the array to a string, and use DPL to extract the value.
Am I on the correct track, or maybe there are better ways to achieve this?
For later, happy new year!
Solved! Go to Solution.
01 Jan 2025 08:59 PM
@henk_stobbe yes, this is one of the solutions. you can also use a combination of expand / parse / filter - for example how get the dt.owner tag value:
fetch dt.entity.host
| fieldsAdd tags
| expand tags
| parse tags, """((LD:tag (!<<'\\' ':') LD:value)|LD:tag)"""
| fieldsAdd dt.owner = if(isNotNull(value), value)
| filter tag=="dt.owner"
| fieldsRemove value, tags, tag
02 Jan 2025 08:06 AM
Hi Julius,
Best wishes! And thanks for your great answer,
KR Henk