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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...