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

BizEvents not capture multiple values

gbaudart
DynaMight Champion
DynaMight Champion

Hello Community,

I've some questions about BizEvents and issues I'm encountering.
This is my first time working on BizEvents, so the answers may be simple.

 

I would like to retrieve the “Request-Body” information from an action.
To keep it simple, I started by collecting the entire body (it works well):

gbaudart_0-1704795894379.png

I run my DQL command, and we see that I have recovered the entire body:

gbaudart_1-1704795894385.png

 

One of the problems I encounter is when there are multiple values for the same variables in the body.

gbaudart_2-1704795894386.png

 

I don't know how to process it to retrieve all "nR" and "nC" values.
I would like a BizEvent record by “CorrelationId”.

 

When I try to parse the BizEvent, I only get the first row.

gbaudart_3-1704795894389.png

Question #1: How to obtain a row by CorrelationId?

 

Sometimes the variables do not appear in the same order in the body. So I get “null” in this case.

Question n°2: How do I obtain the values of my variables whatever the order in which they appear?

Then I tried not to capture the entire body but only the fields that interest me. (e.g. “nC”) :

gbaudart_4-1704795894389.png

Only, I have nothing going back to this field.

Question #3: Do you know how I could configure each of these fields for it to work?

 

Observability Consultant - Dynatrace Professional Certified
6 REPLIES 6

dannemca
DynaMight Guru
DynaMight Guru

Is your response body a json? If so, you can use the path to point the exactly field you need, let's say the field you need is the correlationID, then you need to tell the path to look for it, but in your case you will need to provide also a position, since it seems to be a list, so it should be something like 0.correlationID, this should get you the value from first row.

The problem here is when you don't know how many positions you will get in the result... you will end up like me here: https://community.dynatrace.com/t5/DQL/is-it-possible-to-search-and-parse-an-specific-Json-List/td-p...

:donotpass:

Site Reliability Engineer @ Kyndryl

gbaudart
DynaMight Champion
DynaMight Champion

@dannemca ,

Thanks for this.

I think it's actually .json.
Indeed, the number of positions may vary. However, unlike you, I cannot have empty positions.
I'll look into that to see what I can do.

Observability Consultant - Dynatrace Professional Certified

gbaudart
DynaMight Champion
DynaMight Champion

Does anyone have an idea for question #3?

Observability Consultant - Dynatrace Professional Certified

Maybe take a look at this, it could help :

https://community.dynatrace.com/t5/Developer-Q-A-Forum/DQL-DPL-Transposing-Arrays-into-lines/m-p/230...

Observability Consultant - Dynatrace Associate

gbaudart
DynaMight Champion
DynaMight Champion

Thanks @Pierre_L 
For Q#1 & Q#2, it's resolved with :

 

fetch bizevents
| fieldsAdd Ximestamp = timestamp
| filter isNotNull(responsebodyfull)
| parse responsebodyfull, "JSON(strict=false):json"
| expand jobs=json[jobs]
| parse jobs, """LD '"correlationId":' STRING:correlationId LD '"montantE":' INTEGER:montantE LD '"nR":' INTEGER:nR LD '"nC":' INTEGER:nC LD '"XX":' STRING:XX LD '"formule":' STRING:formule"""
| fields XTimestamp, correlationId, nR, nC, XX, montantE
| limit 10000

 

Observability Consultant - Dynatrace Professional Certified

gbaudart
DynaMight Champion
DynaMight Champion

For Question #3, I made progress with this config :

gbaudart_0-1705591064489.png

But I still have a problem.

This allows me to only recover the variable at the indicated position (here 0).
How do I make this able to retrieve all existing positions?

Observability Consultant - Dynatrace Professional Certified

Featured Posts