I've come across a strange anomoly with Event Bridge.
I have an incoming message to eventbridge. This comes through with some details, namely an array of 'items'. In the interest of message brevity and transferring only the data I want to pass on, I've setup a rule to transform it down.
The json of the 'detail' of the message looks like this:
{"detail" :
{"sale" :
{"items" :
[{
"product" : "cheese",
"quantity" : 1
},
{
"product" : "tomato",
"quantity" : 1
}]
}
}
}
I have tried setting the input transformer to the following but am not getting any success.
$.detail.sale.items
$.detail.sale.items[*]
$.detail.sale.items.*
(the above are either invalid when setting the input transformer, or they simply don't trigger the rule to send anything on)
However if I use:
$.detail.sale.items[0].quantity
It happily returns the number 1 for me.
It's almost like EventBridge items with children, you can't select multiples. Or items with multiple levels, you need to select the very lowest level to get data the data out.
AWS doco only ever points to examples with lowest level json objects, or singular hard-referenced array items.
Has anyone got this working with child items or arrays?