DEV Community


Generating JSON Data in Apache NiFi

Timothy Spann
I am a Developer Advocate at Streamnative. I work with Apache Pulsar, Apache Flink, Apache NiFi, Apache Spark, IoT, MXNet, DLJ.AI, Deep Learning, Machine Learning, Streaming...
Originally published at on ・1 min read

Example of a JSON IoT Generator


"ip": "${ip()}",
"unique_id": "${UUID()}",

"thread": "${thread()}",

"hostname": "${hostname()}",

"sensor_9": ${random():mod(100)},

"sensor_id": ${random():mod(30)},

"sensor_3": ${random():mod(50)},

"sensor_2": ${random():mod(500)},

"sensor_1": ${random():mod(110)},

"sensor_0": ${random():mod(150)},

"sensor_7": ${random():mod(255)},

"sensor_6": ${random():mod(95)},

"sensor_5": ${random():mod(80)},

"sensor_ts": ${now():toNumber()},

"sensor_8": ${random():mod(120)},

"sensor_4": ${random():mod(60)},

"sensor_11": ${random():mod(20)},

"sensor_10": ${random():mod(10)}



Discussion (0)