<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Which macro instance Splunk runs? in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Which-macro-instance-Splunk-runs/m-p/292427#M2565</link>
    <description>&lt;P&gt;Suppose I have 3 macros of the same name, one defined for user admin, other for application MyApp  and the third one as Global. I am logged in as admin, in application MyApp and referencing the macro in the query. Which macro Splunk uses? What are the preferences?&lt;/P&gt;

&lt;P&gt;The same question is in place for other objects like reports, dashboards, data models,&lt;/P&gt;

&lt;P&gt;Question2: Is there a specific syntax to direct the search to use other instance?&lt;/P&gt;

&lt;P&gt;mdz&lt;/P&gt;</description>
    <pubDate>Thu, 09 Feb 2017 14:23:30 GMT</pubDate>
    <dc:creator>mdzmuran</dc:creator>
    <dc:date>2017-02-09T14:23:30Z</dc:date>
    <item>
      <title>Which macro instance Splunk runs?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Which-macro-instance-Splunk-runs/m-p/292427#M2565</link>
      <description>&lt;P&gt;Suppose I have 3 macros of the same name, one defined for user admin, other for application MyApp  and the third one as Global. I am logged in as admin, in application MyApp and referencing the macro in the query. Which macro Splunk uses? What are the preferences?&lt;/P&gt;

&lt;P&gt;The same question is in place for other objects like reports, dashboards, data models,&lt;/P&gt;

&lt;P&gt;Question2: Is there a specific syntax to direct the search to use other instance?&lt;/P&gt;

&lt;P&gt;mdz&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2017 14:23:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Which-macro-instance-Splunk-runs/m-p/292427#M2565</guid>
      <dc:creator>mdzmuran</dc:creator>
      <dc:date>2017-02-09T14:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Which macro instance Splunk runs?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Which-macro-instance-Splunk-runs/m-p/292428#M2566</link>
      <description>&lt;P&gt;Question1: Check out the precedence docs:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.5.1/Admin/Wheretofindtheconfigurationfiles"&gt;https://docs.splunk.com/Documentation/Splunk/6.5.1/Admin/Wheretofindtheconfigurationfiles&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;It seems like the precedence would be in your case : global &amp;gt; app &amp;gt; user .&lt;BR /&gt;
Which means the global one will run eventually.&lt;/P&gt;

&lt;P&gt;Question2: I don't think you can run any configuration that was overridden by another, since it will always load one time any line in a stanze.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2017 22:01:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Which-macro-instance-Splunk-runs/m-p/292428#M2566</guid>
      <dc:creator>ehudb</dc:creator>
      <dc:date>2017-02-09T22:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Which macro instance Splunk runs?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Which-macro-instance-Splunk-runs/m-p/292429#M2567</link>
      <description>&lt;P&gt;Question 2: No, there is no way for the user of a macro to direct Splunk to use a different version.&lt;/P&gt;

&lt;P&gt;Question 1: Which macro Splunk uses, depends on configuration file precedence. You can read up on config file precedence in the Admin manual &lt;A href="https://docs.splunk.com/Documentation/Splunk/6.5.1/Admin/Wheretofindtheconfigurationfiles"&gt;here&lt;/A&gt;. That page also has a reference to &lt;STRONG&gt;btool&lt;/STRONG&gt; which can be very helpful to see how Splunk combines the configuration files. You might also want read &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.1/Troubleshooting/Usebtooltotroubleshootconfigurations"&gt;Use btool to troubleshoot configurations&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;To see exactly what is happening in your case, you might try running the following command on the command line of your search head:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk cmd btool --app=MyApp --user=admin macro list --debug
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And specifically, in your example, Splunk will evaluate the macros.conf files in the following order, using the first definition it finds:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SPLUNK_HOME/etc/users/admin/MyApp/local/macros.conf
SPLUNK_HOME/etc/apps/MyApp/local/macros.conf
SPLUNK_HOME/etc/apps/MyApp/default/macros.conf
SPLUNK_HOME/etc/system/local/macros.conf
SPLUNK_HOME/etc/apps/*/local/macros.conf [but only for macros with global visibility]
SPLUNK_HOME/etc/apps/*/default/macros.conf  [but only for macros with global visibility]
SPLUNK_HOME/etc/system/default/macros.conf
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Feb 2017 23:41:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Which-macro-instance-Splunk-runs/m-p/292429#M2567</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2017-02-09T23:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Which macro instance Splunk runs?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Which-macro-instance-Splunk-runs/m-p/292430#M2568</link>
      <description>&lt;P&gt;Thanks for the answer. This brings another question. How can I direct Splunk to store any object in a specific directory. The Splunk UI has 3 options only, Privat, AppContext and Global, but we have at least seven options in the above list of directories.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 12:18:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Which-macro-instance-Splunk-runs/m-p/292430#M2568</guid>
      <dc:creator>mdzmuran</dc:creator>
      <dc:date>2017-02-10T12:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Which macro instance Splunk runs?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Which-macro-instance-Splunk-runs/m-p/292431#M2569</link>
      <description>&lt;P&gt;We have 3 major location options, two of them expand into local+default.&lt;BR /&gt;
Plus we have permission options within the app: (app\global)&lt;/P&gt;

&lt;P&gt;Major:&lt;BR /&gt;
Private&lt;BR /&gt;
App&lt;BR /&gt;
System&lt;/P&gt;

&lt;P&gt;Expanded to default\local:&lt;BR /&gt;
Private&lt;BR /&gt;
App-default&lt;BR /&gt;
App-local&lt;BR /&gt;
System-default&lt;BR /&gt;
System-local&lt;/P&gt;

&lt;P&gt;Expanded to app\global:&lt;BR /&gt;
Private&lt;BR /&gt;
App-default (App-only)&lt;BR /&gt;
App-local (App-only)&lt;BR /&gt;
App-default (Global)&lt;BR /&gt;
App-local (Global)&lt;BR /&gt;
System-default&lt;BR /&gt;
System-local&lt;/P&gt;

&lt;P&gt;The override order would be:&lt;BR /&gt;
Private&lt;BR /&gt;
App-default (App-only)&lt;BR /&gt;
App-local (App-only)&lt;BR /&gt;
System-local&lt;BR /&gt;
App-default (Global)&lt;BR /&gt;
App-local (Global)&lt;BR /&gt;
System-default&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 13:21:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Which-macro-instance-Splunk-runs/m-p/292431#M2569</guid>
      <dc:creator>ehudb</dc:creator>
      <dc:date>2017-02-10T13:21:46Z</dc:date>
    </item>
  </channel>
</rss>

