How to use first line in CSV as the headers for Parser function
So I have a script that will collect data from an API. The data is returns is CSV formatted, the first line will be the list of fields. How do you tell Stream to use that first line as the headers?
Best Answer
-
Hi @rolltidega, Cribl Stream has a default "CSV Ruleset" that will extract the field names based on the CSV header and automatically unroll each line into an individual event.
Im assuming youre using a scripted collector… you can add the event breaker by opening the scripted collector config and click on Event Breakers on the left side of the config. Add a ruleset and select "CSV Ruleset" from the dropdown.
0
Answers
-
Hi @rolltidega, Cribl Stream has a default "CSV Ruleset" that will extract the field names based on the CSV header and automatically unroll each line into an individual event.
Im assuming youre using a scripted collector… you can add the event breaker by opening the scripted collector config and click on Event Breakers on the left side of the config. Add a ruleset and select "CSV Ruleset" from the dropdown.
0 -
Yeah I found that thanks.
0