I'm trying to pass a csv file which doesn't have column names. Each row in the file is also different (different variables, as well as varying row lengths), and would need more personalized column names.
What I want to do is alternate between column names based on the first character of the row (it'll be a one digit number which indicates which column set is needed) My method so far is to create an initial columns field to retrieve the first character, then check its value and then finalise the columns based on that value.
This method isn't really working and seems to sort of merge the columns in places. For instance when [c1] == 2, the column names appear something like e1, e2, e3, c3 [Essentially names form the initial columns set are added to the new one].
Hi, could you give me an example on how I would do this? I'm not sure how I would be able to have some sort of conditional when I don't even have variables defined etc.?
In the above example, instead of using tags as conditional the grok message captured can be used.
So basically, your grok will capture data in two parts, the first can capture the first digit of your line and the second part can be a greedydata filter.
Using this, you can write a better conditional.
Paste a sample input in case you still can't do it, I'll help you out once I get some time.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.