Ad Widget

Collapse

LLD for JSON Items

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mpmichael
    Junior Member
    • Mar 2019
    • 9

    #1

    LLD for JSON Items

    Hello,

    i just try to generate items from a JSON input like:

    Code:
     
     {"stats": [{"customer":{"id":4,"companyName":"fantasia"},"count":0, "statusCounts":[{"status":"INIT","count":0},{"status":"IN_PROGRESS","count":0},{"status":"FINISHED","count":0}], "noResultCount":0, "resultCounts":[ {"type":"BUSY","count":0}, {"type":"TIMEOUT","count":0}, {"type":"FAIL","count":0}, {"type":"NORMAL","count":0}], "detailsCounts":[ {"resultUrlRequestStatus":"OK","count":0}, {"resultUrlRequestStatus":"ERROR","count":0}, {"resultUrlRequestStatus":null,"count":0}]}, {"customer":{"id":12,"companyName":"ExampleCo"},"count":1, "statusCounts":[{"status":"INIT","count":0},{"status":"IN_PROGRESS","count":0},{"status":"FINISHED","count":1}], "noResultCount":0, "resultCounts":[ {"type":"BUSY","count":0}, {"type":"TIMEOUT","count":0}, {"type":"FAIL","count":0}, {"type":"NORMAL_CLEARING","count":1}], "detailsCounts":[ {"resultUrlRequestStatus":"OK","count":1}, {"resultUrlRequestStatus":"ERROR","count":0}, {"resultUrlRequestStatus":null,"count":0}]} ]}
    I would like to monitor the status of every "companyName" / "resultCounts"...

    My Idea was to use the Http agent as a discovery rule
    Click image for larger version

Name:	image864.gif
Views:	358
Size:	38.7 KB
ID:	375390
    Then I tried to use "Depended Items" as "Item Prototypes" but I couldn't select the "Discovery rule".

    Then I did the same and used the same settings (as for the discovery rule) as a normal Item. Then I added a "Item prototype" as "Dependent Item".

    Used this settings:
    Name: TestItem
    Type: Dependent Item
    key: test.item[#ID]
    Master Item: <the master Item>
    Type of Information: Text

    and Preprocessing:

    JSON Path $.customer.companyName

    I can see that the "master Item" returns valid Data - but the "dependent Item" returns: Cannot create item: item with the same key "test.item[#ID]" already exists..

    Any Idea?
    Best regards
    ​​​​​​​Martin

Working...