Getting Data In

How can I index data from a CSV file with 2 header lines

dajomas
Path Finder

Hi all,

I have CSV files  (they are exports from the Garmin R10 launch monitor session data via the Garmin Golf app) that contain 2 header lines, the first header line contains the field names and the second header line contains the unit of measurement (or blank if not applicable)

For example:

Date,Player,Club Name,Club Type,Club Speed,Attack Angle,...
,,,,[mph],[deg],...
09/10/23 10:00:45 AM,Johan,7 Iron,7 Iron,70.30108663634557,-7.360383987426758,...

 

Now, I would like to index the data in one of 2 ways:

  1. Add the unit of measurement to the value
    1. so that would become "70.30108663634557mph" for the Club Speed field
  2. Add an additional column that contains the unit of measurement
    1. Add column "Club Speed UOM" with value mph for every line indexed from the CSV file and do this for every column that contains a valid unit of measurement

For me, option 2 would be the preferred option

A third option, would be to skip the unit of measurement line altogether but I would rather not use this option.

 

I would appreciate any help that points me in the right direction to solve this challenge.

 

Thanx in advance.

Labels (1)
Tags (3)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

I would write a script that converts the CSV into K=V format and run it as a scripted input.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...