<?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: How to use regex in eventtypes.conf in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-in-eventtypes-conf/m-p/222474#M65433</link>
    <description>&lt;P&gt;For any search, you can look at the job inspector (Job &amp;gt; Inspect Job) and find the row "canBeEventType" which will be set to either 0 (cannot) or 1 (can).&lt;/P&gt;</description>
    <pubDate>Mon, 09 Nov 2015 19:44:50 GMT</pubDate>
    <dc:creator>aljohnson_splun</dc:creator>
    <dc:date>2015-11-09T19:44:50Z</dc:date>
    <item>
      <title>How to use regex in eventtypes.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-in-eventtypes-conf/m-p/222467#M65426</link>
      <description>&lt;P&gt;I have data in following formats:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Nov 04 21:47:59 server1 gtu[22038]: 2833CA0D c   (master)   1A 0B 81 2D 5F 66 36 A7 DC F3 60 B0 
Nov 04 21:47:59 server1 gtu[22038]: 2833CA0D c   (master)   02 6D A0 3C B1 B3 59 CD EC BC CB 7B 55 65 85 CA 
Nov 04 21:47:59 server1 gtu[22038]: 2833CA0D c   (master)   82 70 29 01 02 06 02 BE 04 A5 FB 6C 1F 90 1D 40 
Nov 04 21:47:58 server1 gtu[22038]: 2833CA0D c   (master)   7E A0 51 E5 B2 CA 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need to set this as one eventtype.&lt;BR /&gt;
Number of data field can go from 2 to 16.&lt;BR /&gt;
With normal search, I can use this format:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* | regex _raw="gtu.* \(master\)\s+\w\w\s+\w\w" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But in &lt;STRONG&gt;eventypes.conf&lt;/STRONG&gt; this does not work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[gtu-master-data]
search = regex _raw="gtu.* \(master\)\s+\w\w\s+\w\w" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Does &lt;STRONG&gt;regex&lt;/STRONG&gt; not work in *&lt;EM&gt;eventypes.conf&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2015 12:51:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-in-eventtypes-conf/m-p/222467#M65426</guid>
      <dc:creator>lakromani</dc:creator>
      <dc:date>2015-11-09T12:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to use regex in eventtypes.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-in-eventtypes-conf/m-p/222468#M65427</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
There is some examples in this post that may help you:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/293531/how-to-write-the-regex-for-transformsconf-to-extra.html"&gt;https://answers.splunk.com/answers/293531/how-to-write-the-regex-for-transformsconf-to-extra.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2015 13:51:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-in-eventtypes-conf/m-p/222468#M65427</guid>
      <dc:creator>clorne</dc:creator>
      <dc:date>2015-11-09T13:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to use regex in eventtypes.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-in-eventtypes-conf/m-p/222469#M65428</link>
      <description>&lt;P&gt;Pipes, and other non-streaming commands are not allowed in event types. The &lt;CODE&gt;search&lt;/CODE&gt; definition must contain &lt;EM&gt;only&lt;/EM&gt; the basics of a simple search - no pipes, no transactions, not regex, nothing other than the "base search" that will match your event type.&lt;/P&gt;

&lt;P&gt;So your eventtype in this case will be the following, since this will only &lt;CODE&gt;include&lt;/CODE&gt; things that match the search definition.&lt;/P&gt;

&lt;P&gt;eventtypes.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[gtu-master-data]
 search = gtu master master_hex=*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [your_sourcetype]
 EXTRACT-hex_values = gtu\[(?&amp;lt;process_pid&amp;gt;[^\]]+)\]:[^\(]+\(master\)\s+(?&amp;lt;master_hex&amp;gt;(?:[a-fA-F0-9\s]{2})+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;UPDATE: so this &lt;EM&gt;should&lt;/EM&gt; work, but I haven't tested it. Basically, in the &lt;CODE&gt;props.conf&lt;/CODE&gt; you specify the Extraction for "Master Hex" values, (call it what you want), that matches the formation of hex values. Then you use the event type to limit those events that have any value of master hex. &lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0/Knowledge/Abouteventtypes"&gt;http://docs.splunk.com/Documentation/Splunk/6.0/Knowledge/Abouteventtypes&lt;/A&gt;&lt;BR /&gt;
Here's the restriction documentation (from below comment) &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.1/Knowledge/defineeventtypes#Important_event_type_definition_restrictions"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.1/Knowledge/defineeventtypes#Important_event_type_definition_restrictions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2015 14:59:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-in-eventtypes-conf/m-p/222469#M65428</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2015-11-09T14:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to use regex in eventtypes.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-in-eventtypes-conf/m-p/222470#M65429</link>
      <description>&lt;P&gt;@alacercogitatus; I did read that link before I posted my comment and you will note that the documentation does not mention this limitation (which I was pretty sure existed, since that was always how I wrote them).  The documentation definitely needs an update to call this out.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2015 15:39:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-in-eventtypes-conf/m-p/222470#M65429</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-11-09T15:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to use regex in eventtypes.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-in-eventtypes-conf/m-p/222471#M65430</link>
      <description>&lt;P&gt;Problem is that doing this will hit lots of other stuff, that is already to tagged.&lt;BR /&gt;
So I need to differentiate this data from other stuff.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2015 16:36:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-in-eventtypes-conf/m-p/222471#M65430</guid>
      <dc:creator>lakromani</dc:creator>
      <dc:date>2015-11-09T16:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to use regex in eventtypes.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-in-eventtypes-conf/m-p/222472#M65431</link>
      <description>&lt;P&gt;The documentation in the Knowledge Manager Manual does have the restrictions in place. I agree, the spec should be updated to include the specific line.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; You cannot base an event type on a search that includes a pipe operator or a subsearch .

  In addition, you cannot base an event type on a search that references a report. For example, if you have a report with the name failed_login_search, you can't create an event type that is defined by savedsearch=failed_login_search. In a case like this you should always give the event type the same search string as the report. 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.1/Knowledge/defineeventtypes#Important_event_type_definition_restrictions"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.1/Knowledge/defineeventtypes#Important_event_type_definition_restrictions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2015 16:44:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-in-eventtypes-conf/m-p/222472#M65431</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2015-11-09T16:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to use regex in eventtypes.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-in-eventtypes-conf/m-p/222473#M65432</link>
      <description>&lt;P&gt;You need to create a field-extraction that qualifies/classifies the events (like &lt;CODE&gt;number_of_bytes&lt;/CODE&gt;) and then create an eventtype based on that (like &lt;CODE&gt;number_of_bytes = 2&lt;/CODE&gt;).&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2015 16:46:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-in-eventtypes-conf/m-p/222473#M65432</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-11-09T16:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to use regex in eventtypes.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-in-eventtypes-conf/m-p/222474#M65433</link>
      <description>&lt;P&gt;For any search, you can look at the job inspector (Job &amp;gt; Inspect Job) and find the row "canBeEventType" which will be set to either 0 (cannot) or 1 (can).&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2015 19:44:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-regex-in-eventtypes-conf/m-p/222474#M65433</guid>
      <dc:creator>aljohnson_splun</dc:creator>
      <dc:date>2015-11-09T19:44:50Z</dc:date>
    </item>
  </channel>
</rss>

