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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...