Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

SPLIT json and parse new filed in NIFI

avatar
Explorer

"result" : "SUCCESS",
"correlationID" : "X8058296",
"generationTimestamp" : "1354",
"meHostName" : "rc01;rik2jc",
"nccVersion" : "SPS__R1",

 
This is my input in my nifi and i want to do changes in meHostName means i want mehostName to have 1st value like in this case rc01 and after that creating 1 more field with name devicename having second value means rik2jc
 
I acheived the 1st part means i configured in UpdateRecord processor 
Ashi_0-1727079245645.png

for meHostName and it is printing 1st value means it is running fine ,now please help me in acheiving devicename to have 2nd value of meHostName which is rik2jc . i have tried split(/meHostName, ';')[1] but its not working

 
 
 
 
 
1 REPLY 1

avatar
Super Collaborator

You can achieve the same with a JOLT shift and this spec:

{
    "*": "&",
    "meHostName": {
        "*;*": {
            "$(0,1)": "case",
            "$(0,2)": "devicename"
        }
    }
}