Ad Widget

Collapse

Item Prototype Discovery JSON

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • focar
    Junior Member
    • Dec 2023
    • 17

    #1

    Item Prototype Discovery JSON

    Hello

    I'm struggling with a discovery process and cannot get it to work properly. I'm pretty sure it is a PEBCAK problem but i hope someone can help me.

    I got this JSON object:




    i need to discover the client_name and service_name. And the value[1] is the item that needs to be monitored.

    So far i got it right for the name and service name. This is discoverd well, but the value seems to be the tricky one.


    Discovery Rule:

    Preprocessing steps :
    JSONPath $.data.result[*]

    LLD Macros :
    {#CNAME} $.metric.client_name
    {#SERVICE} $.metric.service_name
    {#VALUE} $.value[1]



    Item Prototype:

    key lynx_svc.util[{#CNAME}{#SERVICE}]
    type float

    Preprocessing:
    JSONPath $.{#VALUE}


    I get this error on item:

    Cannot update item: invalid value for preprocessing step #1: unsupported construct in jsonpath starting with: ""9.82"]". \\\

    It looks like it is showing the correct value in the error. I'm pretty sure it is a syntax error in my construct but i tried several but nothing seems to do the job for me

    What could i be missing here? Many thanks



  • focar
    Junior Member
    • Dec 2023
    • 17

    #2
    Hey,

    After some searching and comparing with existing JSONpath configs i got it working. For whoever this is helpful, this is the parameter is used in the item property:

    $..[?(@.value[1] == "{#VALUE}")].value[1].first()


    Now i have another issue with the type that is returned but i will figure that out.

    grts



    Comment

    Working...