Ad Widget

Collapse

Regular expression in Post-procesing steps and JSONPath

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rudlafik
    Senior Member
    • Nov 2018
    • 144

    #1

    Regular expression in Post-procesing steps and JSONPath

    Hi,

    I have this JSON:
    [
    {"{#INSTANCE}": "HarddiskVolume1"},
    {"{#INSTANCE}": "HarddiskVolume2"},
    {"{#INSTANCE}": "C:"},
    {"{#INSTANCE}": "E:"},
    {"{#INSTANCE}": "F:"},
    {"{#INSTANCE}": "_Total"}
    ]
    When I try this code "A": $..[?(@['{#INSTANCE}'] =~ ":")].['{#INSTANCE}']

    Result is:
    ["C:","E:","F:"]​
    When I try this code "B" with regular expression: $..[?(@['{#INSTANCE}'] =~ /\w:/)].['{#INSTANCE}']

    Result is ERROR:
    HTML Code:
    cannot extract value from json by path "$..[?(@['{#INSTANCE}'] =~ /\w:/)].['{#INSTANCE}']": unsupported construct in jsonpath starting with: "/\w:/)].['{#INSTANCE}']"
    When i tested code "B" in this walidator test is OK: https://www.site24x7.com/tools/json-path-evaluator.html

    Where is problem? (ZBX 6.4.18)
  • kamil1
    Member
    • Aug 2024
    • 40

    #2
    Hi,
    Please, try to verify agains


    Looks like the syntax you used might not be supported.

    Comment

    Working...