Filtering values with JSON PATH string

Hi,

I need to filter incoming messages from Websocket by variable using the filter on actual values. This is working example of selecting element based on filter variable:
$.[$ip:$port].my_attribute

How to filter out messages based on value? I have done some research and the below line should work, but it isnt.
$.[?(@.my_attr == 5456)]
ultimately, I would create filter using variable:
$.[?(@.my_attr == $my_attr_filter)]

Thank you!
BVS

Hi can you give us an example of your output json? which plugin you are using? (JSON API or infinity ). If infinity I have some example about filtering here.

Sorry. it is very little information in the original query.