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!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...