Skip to main content

Hello,

Can I use regex patterns to filter records based on a field name pattern? Or use them in Field Type converter? 

For example: If a record has field names containing “cost” in them e.g. “Average Cost for two”, “Cost range”, “Parking Costs” etc. I want to send these records to a certain destination? 

Or if the field names including “cost” in them, use field type converter to convert the values to integer.

I did not find any specific information on this in Docs. Played around with a few patterns. But even if some passed validation, they failed in preview. 

 

-Dhanashri

 

Hey Dhanashri,

 

The str:contains function should allow you to do this. Give it a shot. 


@Dhanashri_Bhate 

 

please try the condition in StreamSets collector.

 

${str:contains(record:value('/f1'),'Cost') || str:contains(record:value('/f1'),'cost')}


@Dhanashri_Bhate 

Kindly close the question if the solution helped you on resolving the issue.

 

Thanks & Regards

Bikram_


Hello @Bikram @dima thanks for your inputs.

Unfortunately I have run out of lab time, so could not try this out. Closing the question for now.  

 


Reply