Read CSV File with Header and Filter rows and then convert to JSON using Apache Nifi
Hi,
Im new to Apache Nifi and i'm looking on how to filter the CSV data using specific column.
I'm able to convert to JOSN without filtering, but SplitText and RouteonAttribute processors are not helping to filter the data. Below is my input CSV.
Input:
number,name,resourceState,location,manufacturer
111897,lok,INSTALLED,HYD,ABC
115677,redd,RETIRED,BLR,ABC
1108448,eswar,PROP_INITIAL,CLT,ABC
1116740,wqwq,INITIAL,AA,ABC
Filtering should be based on resourceState column to consider INSTALLED and RETIRED data. So, converted JSON should have only 2 rows like below.
Expected JSON Output:
[{
"number": "111897",
"name": "lok",
"resourceState": "INSTALLED",
"location": "HYD",
"manufacturer": "ABC"
},
{
"number": "115677",
"name": "redd",
"resourceState": "RETIRED",
"location": "BLR",
"manufacturer": "ABC"
}]
Please help me on the CSV filtering part.
Thanks in Advance.

