Dashboards & Visualizations

How to add a new field to Extracted Field

aditsss
Motivator

Hi Everyone,

I have raw logs in this format:

101107134,2105180551,210518,101107236,gcp_salesforce_user_default_opportunity,cstonedb3,0,E3

101107133,2105180545,210518,101107236,gcp_salesforce_user_role,cstonedb3,50,E3

I have extracted the field with the below query

index=abc source="/splunkLogs/JOB_MDJX_CS_EXTR_STATS_PLATINUM.csv"| append [search source="/splunkLogs/JOB_MDJX_CS_EXTR_STATS_GOLD.csv"]
|append [search source="/splunkLogs/JOB_MDJX_CS_EXTR_STATS_SILVER.csv"]| eval fields=split(_raw,",") |eval Environment=mvindex(fields,7)|eval RunDate=mvindex(fields,2)|eval JOBFLOW_ID=mvindex(fields,0) |eval SRC_NM=mvindex(fields,4)|eval REC_COUNT=mvindex(fields,6)|search REC_COUNT!="REC_COUNT" |where Environment="E3"|where JOBFLOW_ID LIKE "%%"|eval Run_Date=strptime(RunDate,"%Y%m%d")|table Run_Date

The one highlighted in bold is rundate. I need to add 20 in front of this to make it 20210518.

Can someone guide me how can I achieve that in my query.

Labels (3)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| eval RunDate="20".mvindex(fields,2)

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust
| eval RunDate="20".mvindex(fields,2)
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...