All Apps and Add-ons

How to locate and edit an existing macro search from an app (Splunk App for Unix and Linux)?

leochan
Explorer

Is there anyway to locate and edit an existing macro search from an App (SA-nix) in this case?

    CPU_Exceeds_Percent_by_Host
        Open in Search Edit
        admin   SA-nix  Global

    CPU_Under_Percent_by_Host
        Open in Search Edit
        admin   SA-nix  Global

    Disk_Used_Exceeds_Perc_by_Host
        Open in Search Edit
        admin   SA-nix  Global

    IO_Utilization_Exceeds_Threshold
        Open in Search Edit
        admin   SA-nix  Global

    IO_Wait_Exceeds_Threshold
        Open in Search Edit
        admin   SA-nix  Global

An example search macro from SA-nix. If I try to append it with function I got an error. Thoughts?

`CPU_Exceeds_Percent_by_Host("`_unix_alert_threshold_CPU_Exceeds_Percent_by_Host`")` 

This results in:

Error in 'fields' command: Invalid argument: 'earliest=-30m' 
`CPU_Exceeds_Percent_by_Host("`_unix_alert_threshold_CPU_Exceeds_Percent_by_Host`")` earliest=-30m
0 Karma
1 Solution

renjith_nair
Legend

its not advisable to change the objects which are part of an app because when you upgrade the app, all your changes will be overwritten. You can write a different macro and use it in case needed.

However, macros are available on disk

$SPUNK_HOME/etc/apps/SA-nix/default/macros.conf

Copy the default macros to $SPUNK_HOME/etc/apps/SA-nix/local/macros.conf and make changes if you still require

---
What goes around comes around. If it helps, hit it with Karma 🙂

View solution in original post

renjith_nair
Legend

its not advisable to change the objects which are part of an app because when you upgrade the app, all your changes will be overwritten. You can write a different macro and use it in case needed.

However, macros are available on disk

$SPUNK_HOME/etc/apps/SA-nix/default/macros.conf

Copy the default macros to $SPUNK_HOME/etc/apps/SA-nix/local/macros.conf and make changes if you still require

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

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...