List of possible expressions used along with the previously mentioned operators, based on above JSON input payload.
- Contains:
$.network[?(@.type =~ /^.*ip.*$/i)]
The expression looks for the element "type" under "network" that contains the "
ip
" string. - Match on prefix:
$.network[?(@.direction =~ /^.*inbound-.*$/i)
The expression looks for the element "direction" under "network" that contains the prefix "
inbound-
" string. - Match on suffix:
$.network[?(@.direction =~ /^.*-outbound.*$/i)
The expression looks for the element "direction" under "network" that contains the suffix "
-outbound
" string. - Match on numeric value:
$.network[?(@.iana_number > 10 )
The expression looks for the element "iana_number" under "network" that contains values greater than "10".
- Match on string value:
$.network[?(@.type == 'ipv6')
The expression looks for the element "type" under "network" that contains exactly the "ipv6" string.
- Match on value and suffix regex:
$.network[?(@.iana_number < 10 || @.direction =~ /^.*-outbound.*$/i)
The expression looks for the element "iana_number" smaller than "10" and for the element "direction" that contains the suffix "
-outbound
" string, both under "network".
- Set
ACTIVE
,INACTIVE
value based on key-value of input data usingconcat
:$.concat(($.[?(@.clearTime == '')].concat(\"ACTIVE\")), ($.[?(@.clearTime != '')].concat(\"INACTIVE\")))
- Calculate timestamp by adding offset time using
concat
and transform time stamp using custom functiontransform_date
:$.concat(@.alarmTime, @.alarmTimeOffset).transform_date(\"yyyy-MM-dd HH:mm:ssXXX\")
- Applying mathematical functions like min(), max(), avg(), stddev() on array like object:
$.parameters.avg()