Splunk Enterprise

How to write queries for splunk macro?

super_saiyan
Communicator

hi everyone, 

Could you guys please help me with the below queries?

how to delete macro from the cli ? ( if the macro permission is private )

how to delete macro from the cli ? ( if the macro permission is this app only)

0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @super_saiyan,

my hint is to delete every kind of object from web so you have a more controlled operation, but anyway, you can go in the related conf file (in your case macro.conf) and manually delete it.

If you did it by CLI, always remember to restart Splunk otherwise your update isn't active.

About the location, there are two positions:

for private macros, you can find them in $SPLUNK_HOME/etc/user/<your_user>/<your_app>/local/macro.conf

for app macros, you can find them in $SPLUNK_HOME/etc/apps/<your_app>/local/macro.conf

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @super_saiyan,

my hint is to delete every kind of object from web so you have a more controlled operation, but anyway, you can go in the related conf file (in your case macro.conf) and manually delete it.

If you did it by CLI, always remember to restart Splunk otherwise your update isn't active.

About the location, there are two positions:

for private macros, you can find them in $SPLUNK_HOME/etc/user/<your_user>/<your_app>/local/macro.conf

for app macros, you can find them in $SPLUNK_HOME/etc/apps/<your_app>/local/macro.conf

Ciao.

Giuseppe

super_saiyan
Communicator

thanks for the quick response @gcusello 

0 Karma

isoutamo
SplunkTrust
SplunkTrust

Hi

This depends on have you a single node SH or SHC cluster and if later are those delivered by Deployer or created with GUI. Also in single node situation there could be a some revision control system and automated CI/CD in use. If those are used then you need to use those otherwise as @gcusello said you can delete it from GUI. As you said that permission for those are private that usually means that those are created locally with GUI and it's safe to remove those with GUI.

r. Ismo

Get Updates on the Splunk Community!

Dashboards: Hiding charts while search is being executed and other uses for tokens

There are a couple of features of SimpleXML / Classic dashboards that can be used to enhance the user ...

Splunk Observability Cloud's AI Assistant in Action Series: Explaining Metrics and ...

This is the fourth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how ...

Brains, Bytes, and Boston: Learn from the Best at .conf25

When you think of Boston, you might picture colonial charm, world-class universities, or even the crack of a ...