Getting Data In

How to remove spaces from CSV column names to get data into a pivot table?

cdstealer
Contributor

Hi,

I'm trying to ingest some CSV files that contain QOS metrics. The issue I have is that I need to get this data into a pivot table which stops and complains of the spaces. Now when I add the extracted attributes, I do have the options to rename each field name. Not an ideal solution if the CSV contains 100+ columns 😞

I've tried defining the SEDCMD "SEDCMD = 's/ //g'" command in props.conf but this had no effect. Has anyone come across this and auto removed the spaces?

eg:
CLASS_MRR_Backup - Throughput (I/O/sec)

So when "Add Auto-Extracted Field", I get the error "Field Name can not contain whitespace, double quotes, single quotes, curly braces or asterisks." even if I use the rename option.

Cheers
Steve

Tags (4)
0 Karma

sundareshr
Legend

sedcmd will not work with Indexed Extractions. Remove the indexed extraction=csv from your props and extract using DELIMs. You will now be able to use SEDCMD to replace spaces with underscore (or whatever)

gpareesi11
Path Finder

I have exactly the same issue, I working to fix it, but if you have found a solution please post the answer.

Thanks

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to July Tech Talks, Office Hours, and Webinars!

What are Community Office Hours?Community Office Hours is an interactive 60-minute Zoom series where ...

Updated Data Type Articles, Anniversary Celebrations, and More on Splunk Lantern

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

A Prelude to .conf25: Your Guide to Splunk University

Heading to Boston this September for .conf25? Get a jumpstart by arriving a few days early for Splunk ...