<?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 Re: Can eventtypes contain macro references in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Can-eventtypes-contain-macro-references/m-p/28117#M258</link>
    <description>&lt;P&gt;If the macro ONLY contains search elements, then it should be able to be used in an eventtype definition. So the example that you have given should work.&lt;/P&gt;

&lt;P&gt;However, if your macro contains a | (pipe) or a subsearch, then the macro cannot be used as part of an eventtype definition.&lt;/P&gt;

&lt;P&gt;Rules for eventtypes &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Defineeventtypes"&gt;here&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Feb 2013 08:31:39 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2013-02-12T08:31:39Z</dc:date>
    <item>
      <title>Can eventtypes contain macro references</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Can-eventtypes-contain-macro-references/m-p/28114#M255</link>
      <description>&lt;P&gt;I'm working on an app, and have defined various macros to allow easier customization.&lt;BR /&gt;&lt;BR /&gt;
An example of my macros.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[fooBar]
definition = fooBar*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then, in my eventtypes.conf, I the following does not work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[myEventType]
search = sourcetype `fooBar`:risk
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I modify eventtypes.conf to remove the macro, it seems to work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[myEventType]
search = sourcetype fooBar*:risk
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there a limitation on eventtypes and macros that I am missing?  I looked through all 46 apps that I have installed, 26 of which have eventtypes.conf specified, and none of them use macros.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;find -L /opt/splunk/etc/apps -name eventtypes.conf -exec grep "\`" {} \;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My only thought is to define an eventtype that mirrors the macro functionality, although in my reading, it sounds like macros are generally preferred to eventtypes (&lt;A href="http://splunk-base.splunk.com/answers/4993/eventtype-vs-saved-search"&gt;reference this splunkbase article on eventtypes vs. saved searches&lt;/A&gt;)&lt;/P&gt;</description>
      <pubDate>Mon, 11 Feb 2013 23:11:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Can-eventtypes-contain-macro-references/m-p/28114#M255</guid>
      <dc:creator>Adam_Sealey</dc:creator>
      <dc:date>2013-02-11T23:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: Can eventtypes contain macro references</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Can-eventtypes-contain-macro-references/m-p/28115#M256</link>
      <description>&lt;P&gt;What are you using the eventtype for in your app? Is it for searches or is it for classification of events?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Feb 2013 23:56:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Can-eventtypes-contain-macro-references/m-p/28115#M256</guid>
      <dc:creator>dart</dc:creator>
      <dc:date>2013-02-11T23:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Can eventtypes contain macro references</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Can-eventtypes-contain-macro-references/m-p/28116#M257</link>
      <description>&lt;P&gt;Yes, it's for different types of events that are within the same sourcetype.  I plan to use these eventtypes several times&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2013 01:13:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Can-eventtypes-contain-macro-references/m-p/28116#M257</guid>
      <dc:creator>Adam_Sealey</dc:creator>
      <dc:date>2013-02-12T01:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: Can eventtypes contain macro references</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Can-eventtypes-contain-macro-references/m-p/28117#M258</link>
      <description>&lt;P&gt;If the macro ONLY contains search elements, then it should be able to be used in an eventtype definition. So the example that you have given should work.&lt;/P&gt;

&lt;P&gt;However, if your macro contains a | (pipe) or a subsearch, then the macro cannot be used as part of an eventtype definition.&lt;/P&gt;

&lt;P&gt;Rules for eventtypes &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Defineeventtypes"&gt;here&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2013 08:31:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Can-eventtypes-contain-macro-references/m-p/28117#M258</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-02-12T08:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Can eventtypes contain macro references</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Can-eventtypes-contain-macro-references/m-p/28118#M259</link>
      <description>&lt;P&gt;Yes, my macros are exactly this simple (some don't even have wildcards).  Do you have any suggestions for troubleshooting where the processing of the eventtype is going south?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2013 22:01:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Can-eventtypes-contain-macro-references/m-p/28118#M259</guid>
      <dc:creator>Adam_Sealey</dc:creator>
      <dc:date>2013-02-12T22:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: Can eventtypes contain macro references</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Can-eventtypes-contain-macro-references/m-p/28119#M260</link>
      <description>&lt;P&gt;Use the search job inspector (appears as a white i on a blue button near the search controls). The search job inspector provides a lot of info, both for valid searches and for searches with errors. It will give you more details on the error messages, and may show you  the macro expansion - if it gets that far.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2013 21:15:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Can-eventtypes-contain-macro-references/m-p/28119#M260</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-02-13T21:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: Can eventtypes contain macro references</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Can-eventtypes-contain-macro-references/m-p/28120#M261</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Have you find the solution for this issue ?&lt;/P&gt;

&lt;P&gt;I am facing the same, In standalone instance this works fine, in cluster (indexer cluster and sh cluster) having a macro in the eventtype definitions makes it fails to work as expected.&lt;/P&gt;

&lt;P&gt;Inspecting the job and search.log did really helped&lt;/P&gt;

&lt;P&gt;Thank you &lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2016 17:37:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Can-eventtypes-contain-macro-references/m-p/28120#M261</guid>
      <dc:creator>guilmxm</dc:creator>
      <dc:date>2016-02-01T17:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Can eventtypes contain macro references</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Can-eventtypes-contain-macro-references/m-p/28121#M262</link>
      <description>&lt;P&gt;macros.conf is normally not replicated to indexers.  This is why it works in stand-alone and not with a distributed search to indexer or cluster.&lt;BR /&gt;
You can add it in distsearch.conf.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2016 11:45:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Can-eventtypes-contain-macro-references/m-p/28121#M262</guid>
      <dc:creator>greich</dc:creator>
      <dc:date>2016-12-30T11:45:44Z</dc:date>
    </item>
  </channel>
</rss>

