Splunk Search

How to replace column values in a CSV with static text?

harshal_chakran
Builder

Hi,
I have a CSV file as shown below:

PARAMETER   VALUE
param1       val1
param4     val2
param2     val3
param1     val4
param7     val5
param2       val6

I want to replace all the values inside column named "PARAMETER" with text "common", so whatever values comes inside column "PARAMETER", it should be changed with text "common", Like below:

PARAMETER   VALUE
common     val1
common     val2
common     val3
common     val4
common     val5
common     val6

Please Help...!!!

Tags (4)
1 Solution

somesoni2
SplunkTrust
SplunkTrust

Options

1) Indextime - REX CMD - props.conf on Indexer/Heavy Forwarder

 [yoursourcetype]
...current configurations...
SEDCMD-staticparam = s/([^,]+),(.*)/common,\2/g

2) Search Time - Calculated fields

[yoursourcetype]
...current configurations...
EVAL-PARAMETER = "common"

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

Options

1) Indextime - REX CMD - props.conf on Indexer/Heavy Forwarder

 [yoursourcetype]
...current configurations...
SEDCMD-staticparam = s/([^,]+),(.*)/common,\2/g

2) Search Time - Calculated fields

[yoursourcetype]
...current configurations...
EVAL-PARAMETER = "common"
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...