<?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: Avoiding duplicate text in eventtype in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Avoiding-duplicate-text-in-eventtype/m-p/41086#M9507</link>
    <description>&lt;P&gt;glennh,&lt;/P&gt;

&lt;P&gt;You can use the eventtype to identify the errors themselves using search text, but the deduplication you are looking for is achieved by extracting a field and using the &lt;CODE&gt;dedup&lt;/CODE&gt; search command.  &lt;/P&gt;

&lt;P&gt;This would look like (keeping in mind my regex will only work with the message you included):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;## eventtypes.conf
[tomcat_errors]
search = sourcetype=tomcat ERROR

## props.conf
[tomcat]
REPORT-error_msg_for_tomcat = error_msg_for_tomcat

## transforms.conf
[error_msg_for_tomcat]
REGEX = \s-\s(Error.*)
FORMAT = error_msg::$1

## search
search = eventtype=tomcat_errors | dedup error_msg
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 13 Jul 2011 22:59:27 GMT</pubDate>
    <dc:creator>hazekamp</dc:creator>
    <dc:date>2011-07-13T22:59:27Z</dc:date>
    <item>
      <title>Avoiding duplicate text in eventtype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Avoiding-duplicate-text-in-eventtype/m-p/41085#M9506</link>
      <description>&lt;P&gt;Hi folks, &lt;/P&gt;

&lt;P&gt;I'm trying to create an eventtype to match ERROR in my tomcat logs.  The log messages for a single service call with an error in my log may contain multiple instances of "error" or "ERROR".  I only want to count each service call error once.&lt;/P&gt;

&lt;P&gt;here is an example from the log:&lt;BR /&gt;
2011/06/28 08:29:54.552 ERROR getAvailableProductsListenerContainer-1 ExchangeDaoImpl - Error accessing database for query: getExchange&lt;/P&gt;

&lt;P&gt;I thought of using a regex to include the timestamp and the ERROR string but I cannot find instructions for an eventype with a regex.  Is this possible?  What is the standard approach for this type of situation?&lt;/P&gt;

&lt;P&gt;thanks&lt;/P&gt;

&lt;P&gt;Glenn&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2011 07:42:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Avoiding-duplicate-text-in-eventtype/m-p/41085#M9506</guid>
      <dc:creator>glennh</dc:creator>
      <dc:date>2011-07-12T07:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding duplicate text in eventtype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Avoiding-duplicate-text-in-eventtype/m-p/41086#M9507</link>
      <description>&lt;P&gt;glennh,&lt;/P&gt;

&lt;P&gt;You can use the eventtype to identify the errors themselves using search text, but the deduplication you are looking for is achieved by extracting a field and using the &lt;CODE&gt;dedup&lt;/CODE&gt; search command.  &lt;/P&gt;

&lt;P&gt;This would look like (keeping in mind my regex will only work with the message you included):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;## eventtypes.conf
[tomcat_errors]
search = sourcetype=tomcat ERROR

## props.conf
[tomcat]
REPORT-error_msg_for_tomcat = error_msg_for_tomcat

## transforms.conf
[error_msg_for_tomcat]
REGEX = \s-\s(Error.*)
FORMAT = error_msg::$1

## search
search = eventtype=tomcat_errors | dedup error_msg
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Jul 2011 22:59:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Avoiding-duplicate-text-in-eventtype/m-p/41086#M9507</guid>
      <dc:creator>hazekamp</dc:creator>
      <dc:date>2011-07-13T22:59:27Z</dc:date>
    </item>
  </channel>
</rss>

