Splunk Search

Search view that only searches on specified index

mplacido
Explorer

Hi,

I'm trying to create a Search view that only searches on the index I specify. But I don't seem to figure out how.
This should be very simple, but I can't find anything on how to do this. Is it possible?

Tags (1)
1 Solution

mplacido
Explorer

After som digging I actually figured it out myself.

I cloned the dasboard view, and added this lines to the xml after the Submit button module parameters.



addterm

myindexname

and then just added the before the Submit module´s

And now every search I make in this view automatically adds index="myindexname" without others seeing it.

View solution in original post

mplacido
Explorer

After som digging I actually figured it out myself.

I cloned the dasboard view, and added this lines to the xml after the Submit button module parameters.



addterm

myindexname

and then just added the before the Submit module´s

And now every search I make in this view automatically adds index="myindexname" without others seeing it.

gkanapathy
Splunk Employee
Splunk Employee

There isn't a totally easy way to do this, other than to construct your view to prepend index=myindex to every base search on the page. This isn't trivial in some cases. Unfortunately, defaulting or restricting automatically is only available to roles, not views. This is a reasonable enhancement request, I think.

jbsplunk
Splunk Employee
Splunk Employee

just start your search with 'index=my_index'

0 Karma
Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...