I have a scenario where I am trying to extract a specific piece of data from the Output of an HTTP module (API call).
The specific piece of data I am trying to extract is “message” as shown below.
HTTP MODULE OUTPUT:
The “message” data shows up in the output of the HTTP module but whenever I try to map to that field from another Module, I get an error that not data was found.
PARSE JSON MODULE:
As you can see below, I used a PARSE JSON module to split the Output of the HTTP module even more, and I believe the error is due to the fact that the exact location of “message” changes every time.
The “message” is always found when type=text, but it can be found in a different “trace” collection every time. So it could be #1, #2, #3, or #4 and I don’t always know which one it’ll be.
SET VARIABLE MODULE:
My solution is to set a Variable using the output of the Parse Data module.
However, I’m not sure I’m getting the logic right.
It should be something like this, where the only variable that determines where the message can be found is when text=type.
Can someone please help me come up with the proper logic to reliably extract this data?
Also, is there a simpler way to do this kind of logic with less modules or in the HTTP module itself?
Thanks for the help.