cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Random behavior from pipeline when trying to work/split on multi-level json data

abhinavsingh
New Contributor

Case/scenrio:

Used assets
Sample input xml below
multiplemstercpttoub454.txt (51.1 KB)
Problematic pipeline asset below
but_why.slp (67.8 KB)
(you may want to remove the splunk, producer etc snaps if connection is unavailable during investigation)

Requirement context around which the problematic random behavior identified:
In input xml, following two tags may repeat any number of times:
RCPT_INVOICE_OUB_IFD
RCPT_INVOICE_LINE_OUB_IFD

Now the need was to split this xml into individual xml containing one of each from above tagsโ€ฆ then transform those xml into a plain text for output

Logic was to ensure both of these are treated as arrays (so even when there is just one value for repeating tags, we would still be able to loop through them after transforming them as array else the same expression may not work for both arrays and map) and split them in order keeping the parent values intact

Problem:
Random behaviorโ€ฆ some times it gives correct 2 outputs where expqty != rcvqty but sometimesโ€ฆ same message is repeated twice!?.

Screenshot highlighting areas of interest:
image

Working run details (when the behavior is correct per expectations):
This time the two outputs are per expectation:
Check the output from 3
image
image
So there were two records in input with expqty != rcvqty and those data were correctly split and processed.

Note the outputs at 1
image

Note the outputs at 2
image

The input and output preview at 2
image

Now tried re-validating a few times until the random wrong behavior kicks inโ€ฆ

Incorrect run details (when the result is wrong)
This time the two outputs are wrong. Same message got processed twice:
Check the output from 3
image
image
So there were two records in input with expqty != rcvqty and one of the records gets repeatedโ€ฆ

Note the outputs at 1
The behavior is correct till here.
It messes at 2
image

Note the outputs at 2
image

Input and output preview at 2
image
How did the value of this tag get swapped? And this happens randomly

Extra notes
a. I tried different approaches at the point 1 like using mapper, structure etc but the random behavior still persisted.
b. As a last resort I had to handle all splitting operation (all of it) within script so the output is always correctโ€ฆ but I am still interested to know the reason for this behavior and a better solution if there is one

0 REPLIES 0