Splunk Search

How to add new field in existing index

jadengoho
Builder

I have a index that have 2 fields only
index="TRIAL_INDEX" fields: sample1, sample2

And i will make a new field by
index="TRIAL_INDEX"
| eval sample3= sample1+sample2

What i want is that sample3 would add to the index , so the next time i search it will appear anywhere.

Tags (1)
0 Karma

mayurr98
Super Champion

hey try this

go to Fields » Calculated fields » Add new
Put Name: sample3
Eval Expression : sample1+sample2

let me know if this helps!

0 Karma

jadengoho
Builder

Yes it is helpful , but is there a way that it will be triggered when a BUTTON CLICK in the dashboard ? or in the SPL itself ?

0 Karma

mayurr98
Super Champion

I do not know but this is achievable by js on a dashboard but then it will not reflect in a raw data.This is the only method I think to reflect in a raw data by default.

0 Karma

cmerriman
Super Champion

you're wanting sample3 always in your results without having to add that eval statement?

0 Karma

jadengoho
Builder

what i want is the sample1, sample2, sample3 would be in the index .
After i eval it i like it to be insert to the index , if that is possible .

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...