How to parse JSON file in a discovery pattern

Antal1
Tera Contributor

How do I parse a JSON file with a "Parse file" operation? I cannot find any example on docs site.

Example:

{ 
    "stuff": {
        "onetype": [
            {"id":1,"name":"John Doe"},
            {"id":2,"name":"Don Joeh"}
        ],
        "othertype": {"id":2,"company":"ACME"}
    }, 
    "otherstuff": {
        "thing": [[1,42],[2,2]]
     }
}
7 REPLIES 7

Antal1
Tera Contributor

Just to be precise, by file parse operation in a pattern I mean this what you see on the screenshot. The result should be a table.

find_real_file.png

Antal1
Tera Contributor

I got it working like this. I am not sure about the syntax, when I try to use XPath to make it more dynamic but it does not seem to work. Nevermind, this fixed one should do it for start.

find_real_file.png

find_real_file.png

That looks about right. With most of these parsing strategies if you highlight the text you want it will figure out the advanced options for you. Either way it looks good.