1

I have a json of the following format

{"contextKeys": [
{"name":"DataDogQues"},
{"priority":"high"}],
"comment":"Please Help!"
}

I am trying to fetch the value of name alone in Monitors but I am unable to do so. log.attributes.[contextKeys.name] fetches the entires conextKeys json array.

Is there any means to fetch just the name from contextKeys in Monitors? Thanks in advance.

1 Answer 1

3

Use the following path in Monitors:

log.attributes.contextKeys.0.name

'.0': selects the first element of the array (index 0).

'.name': extracts the "name" field from the selected element.

Sign up to request clarification or add additional context in comments.

2 Comments

I tried the above code. It still does not work. Is there anything else I could try ?
@SherinaSundarrajan Do you use Jinja template language?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.