Re: Groovy script error, JsonSlurper

2023-05-09 Thread James McMahon
I will try this first thing when I get back on this system this evening. Thank you for your reply Matt. One followup: are there any imports i am overlooking to use json.each? I don't think so, but wanted to check now. Currently I import these json libraries, which I believe are baked into nifi groo

Re: Groovy script error, JsonSlurper

2023-05-08 Thread Matt Burgess
I believe it's your "json.each { jsonObj ->" line, with a JSON object it's going to return a key/value pair so try "json.each { k,v ->" instead and use the key k and value v in your script. On Mon, May 8, 2023 at 9:32 PM James McMahon wrote: > > Hello. I have incoming data that is json. An exampl

Groovy script error, JsonSlurper

2023-05-08 Thread James McMahon
Hello. I have incoming data that is json. An example of one case looks like this: {"id": "20230508215236_4447cd0a-9dca-47cb-90b1-6562cf34155a_Timer-Driven Process Thread-9", "te": "0.9494", "diskusage": "0.2776125422110003.3 MB", "memory": 77, "cpu": 0.58, "host": "172.31.73.197/ip-172-31-73-197.e