Ad Widget

Collapse

How can create preprocessing for item prototype and LLD Macros

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bab
    Senior Member
    • Aug 2020
    • 176

    #1

    How can create preprocessing for item prototype and LLD Macros

    I want to create items with preprocessing and I j have to convert CVS to JSON . So follow is my CVS output

    Timestamp,SP,LINK,Link Failure
    2023-02-08 13:03:30,spa,spa_fc4,1.000
    2023-02-08 13:03:30,spa,spa_fc5,5.000
    2023-02-08 13:03:30,spa,spa_iom_1_fc0,1.000
    2023-02-08 13:03:30,spa,spa_iom_1_fc1,5.000
    2023-02-08 13:03:30,spa,spa_iom_1_fc2,1.000
    2023-02-08 13:03:30,spa,spa_iom_1_fc3,5.000
    2023-02-08 13:03:30,spb,spb_fc4,1.000
    2023-02-08 13:03:30,spb,spb_fc5,5.000
    2023-02-08 13:03:30,spb,spb_iom_1_fc0,1.000
    2023-02-08 13:03:30,spb,spb_iom_1_fc1,16.00
    2023-02-08 13:03:30,spb,spb_iom_1_fc2,1.000
    2023-02-08 13:03:30,spb,spb_iom_1_fc3,4.000


    and I set preprocessing such as attached pic but it does not work and I think relates to preprocessing JSON path . what is the issue ?

    It is showing follow error :

    HTML Code:
    Preprocessing failed for: [{"Timestamp":"2023-02-08 15:05:00","SP":"spa","LINK":"spa_fc4","Link Failure ":"1.000"},{"Timest...
    1. Failed: cannot extract value from json by path "$.[?(@.LINK=="spa_fc4")].['Link Failure'].first()": no data matches the specified path​
    Attached Files
    Last edited by bab; 08-02-2023, 17:05.
  • 234233214
    Junior Member
    • Nov 2022
    • 15

    #2
    You're doing JSONPath pre-processing on the CSV output. First do pre-processing "CSV to JSON", then use that output to do the above mentioned JSONPath pre-processing.

    Comment

    • bab
      Senior Member
      • Aug 2020
      • 176

      #3
      Originally posted by 234233214
      You're doing JSONPath pre-processing on the CSV output. First do pre-processing "CSV to JSON", then use that output to do the above mentioned JSONPath pre-processing.

      I have defined it previously in items such as attached pic . According to error it is showing JSON path is not correct . I think we have to change in json path .

      Attached Files

      Comment

      • 234233214
        Junior Member
        • Nov 2022
        • 15

        #4
        I've tried your steps in my environment and they worked just fine. I got the final output "1.000". There must be some other error which you'll have to investigate.

        Comment

        • bab
          Senior Member
          • Aug 2020
          • 176

          #5
          Originally posted by 234233214
          I've tried your steps in my environment and they worked just fine. I got the final output "1.000". There must be some other error which you'll have to investigate.
          Unfortunately it is showing follow error for me :

          HTML Code:
          Preprocessing failed for: [{"Timestamp":"2023-02-09 11:09:00","SP":"spa","LINK":"spa_fc4","Link Failure ":"1.000"},{"Timest...
          1. Failed: cannot extract value from json by path "$.[?(@.LINK=="spb_iom_1_fc3")].['Link Failure'].first()": no data matches the specified path​

          Comment

          • 234233214
            Junior Member
            • Nov 2022
            • 15

            #6
            try all pre-processing steps within the same item and see if they work. also make sure each item has the right parent item.

            Comment

            • bab
              Senior Member
              • Aug 2020
              • 176

              #7
              Originally posted by 234233214
              try all pre-processing steps within the same item and see if they work. also make sure each item has the right parent item.

              As it has created items just cannot get latest data I think that is relate to json path .

              Comment

              Working...