Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

NIFI JSON event extraction only integers from string

avatar
Explorer

I have a JSON data coming as {"x":"avc123.abc.com"} I would like to have a processor in nifi to extract only the integer (123) from the entire value and output it from the process

secondly, I would like that integer value (123) to be added in the JSON event with different keys such as the final JSON event would be {"x":"avc123.abc.com" "y":"123" }

I already tried routetext and extract text but it didn't work.

2 ACCEPTED SOLUTIONS

avatar
Master Guru
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar
Master Guru
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
5 REPLIES 5

avatar
Master Guru
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar
Explorer

@Shu_ashu  Thank you very much! You saved the day for me. 

avatar
Explorer

How about when i have multiple fields such as {
"x":"avc123.abc.com",
"z":"24 - ny"
}
and I would like to only targer "x" value for "123" and the rest won't get affected such as "z"
so the expected output would be {
"x":"avc123.abc.com",
"z":"24 - ny",
"y":"123"
}

Please note that the "y" value only targeted the "x" and the z shouldn't be picked up?
 

avatar
Explorer

@Shu_ashu  I will wait for your response my friend. Thanks! 

avatar
Master Guru
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login