Knowledge Management

Is it possible to alias a command to another one?

daniel333
Builder

All,

So we're slowly moving off of index=java to index=applicationlogs for a few reasons. Is there a way to alias index=java to index=applicationlogs for users?

0 Karma

s2_splunk
Splunk Employee
Splunk Employee

No, there is no way to transparently alias without changing existing searches. @cusello's approach is valid. You can also create a macro, for example set_app_index, that resolves to index=java OR index=applicationlogs.
Either way, you will have to update saved searches, reports and dashboards with inline searches to take advantage of the abstraction.

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi,
You can use eventtypes instead of indexes.
In other words:
You have to create an eventtype like the folliwing
Index=java OR index=applicationlogs
And then on your searches use
Eventtype=my_eventtype instead of index= applicationlogs
Bye.
Giuseppe

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...