Accessing Tags in XQL

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

Accessing Tags in XQL

L1 Bithead

I can see that tags are exposed on the endpoints dataset in XQL but when I inlcude them in a query they appear (vaguely) as key value pairs thus:

 

"endpoint tags": [], "server_tags":["IAN"]

 

The schema though reports tags as being of type string and not an array

 

I would like to be able to extract just the server tag value(s) and present that in an XQL query, is that possible?

1 REPLY 1

L1 Bithead

I have this working, but it still returns the value in double quotes. I've no idea if there is a btter way to a cheive thgis nor if it possible to remove the quotes but this works for me for now

dataset = endpoints 
| alter server = json_extract(tags,"$.server_tags")
| alter server = trim(server,"[]")
| fields endpoint_name as Host_Name, agent_version as Version, server as Server_Tag

 

  • 1248 Views
  • 1 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!