Getting Data In

Preformat Automatic Report - CSV

rlautman
Path Finder

I have written a report that I wish to have delivered automatically by Splunk in a csv file so I can open it in excel. The first few tests I have ran are sending the report in a csv file but in instances where there are several items in one 'cell', a new line character is inserted.

My data is currently appearing like this:
ID Product Delivered
1234 TV\nRadio\nDVD Y\nN\nY

But I want it to appear like this
ID Product Delivered
1234 TV Y
Radio N
DVD Y

Is there anyway I can format the information in the csv before it is sent out?

Tags (2)
0 Karma
1 Solution

lguinn2
Legend

I think it is problematic to output data into a CSV when you have multivalued fields. I would suggest that you use some commands such as mvexpand to eliminate the multivalued fields and then export your data to CSV. Or don't use the list or values functions for reports that you intend to export.

View solution in original post

0 Karma

lguinn2
Legend

I think it is problematic to output data into a CSV when you have multivalued fields. I would suggest that you use some commands such as mvexpand to eliminate the multivalued fields and then export your data to CSV. Or don't use the list or values functions for reports that you intend to export.

0 Karma

rlautman
Path Finder

mvexpand does seem to be the right idea, but I have several multivalue fields in my report - 4 fields each with a minimum of 5 values - I have tried using multiple mvexpand statements but this causes some very strange errors

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...