Splunk Search

how do i use the variable name1 in the table command later?

pratyushd
New Member

... |rename General.SetupViews as Modes|eval mode=split(Modes," ")|eval name1=mvindex(mode,0) | eval name2=mvindex(mode,1) | eval name3=mvindex(mode,2) | eval name4=mvindex(mode,3) | spath | table SetupDetail.name1.IN2OUT as IN2OUT

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Use a field in table by specifying the exact field name or a name pattern.

table name1 name2 name3 name4
Or

table name*

The table command does not have an as option. Use a separate rename.

rename SetupDetail.name1.IN2OUT as IN2OUT | table IN2OUT
---
If this reply helps you, Karma would be appreciated.
0 Karma

renjith_nair
Legend

@pratyushd,

table SetupDetail.name1.IN2OUT as IN2OUT doesn't seem to be correct.

|rename General.SetupViews as Modes|eval mode=split(Modes," ")|eval name1=mvindex(mode,0) 
| eval name2=mvindex(mode,1) | eval name3=mvindex(mode,2) | eval name4=mvindex(mode,3) 
| spath | rename SetupDetail.name1.IN2OUT as IN2OUT|table name1,name2,name3,name4,IN2OUT
---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma

pratyushd
New Member

Hi,
the command SetupDetail.name1.IN2OUT itself does not seem to work. It is not able to extract the value of name1 but puts name1 instead the value i.e mvindex(mode,1) in the option SetupDetail.name1.IN2OUT
Thanks for the help 🙂

0 Karma

renjith_nair
Legend

Do you have some sample events and search ?

---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...