Ad Widget

Collapse

Convert key value pair to JSON

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • juanpablo
    Junior Member
    • Feb 2023
    • 2

    #1

    Convert key value pair to JSON

    Hi,

    I have this command output format in:

    key1 : value1
    key2 : value2
    key3 : value3

    I'd like to get the value from the specific key.

    I tried to convert this using CSV to JSON with colon as delimiter, but I got the output

    [{"1":"key1 ","2":" value2"},{"1":"key2 ","2":" value2"},{"1":"key3 ","2":" value3"}]


    Or any other method possible. I am trying to create an item based on the value cannot find a way to do it.

    Thanks in advance.​
  • Piotrekzielony
    Junior Member
    • Oct 2021
    • 17

    #2
    From where you get this output?

    Comment

    • Semiadmin
      Senior Member
      • Oct 2014
      • 1625

      #3
      Originally posted by juanpablo
      [{"1":"key1 ","2":" value2"},{"1":"key2 ","2":" value2"},{"1":"key3 ","2":" value3"}]
      This is enough to create a LLD rule and get values for dependent items via JSONPath

      Comment

      Working...