Ad Widget

Collapse

Does JSONPath support macros?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Henry78
    Junior Member
    • Jun 2020
    • 6

    #1

    Does JSONPath support macros?

    I try to use {HOST.CONN} in a JSONPath preprocessing rule.

    Code:
    # This works
    $.nodes[?(@.host =~ "192.168.0.100")]
    
    # Checking value of HOST.CONN
    {HOST.CONN}: 192.168.0.100
    
    # This does not work
    $.nodes[?(@.host =~ "{HOST.CONN}")]
    I tried a lot of escaping variants, but can't make it work.
    Does anybody spot the error? Are macros supported in preprocessing?
    Last edited by Henry78; 15-09-2021, 09:15.
  • Henry78
    Junior Member
    • Jun 2020
    • 6

    #2
    But I found that user macros work in LLD preprocessing. So I think I can work around, though this complicates things for me.

    Is this work a feature request?

    Comment

    Working...