<?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: Linecount issue when searching logs in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Linecount-issue-when-searching-logs/m-p/30255#M178003</link>
    <description>&lt;P&gt;Sure, try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="Cron_SendNotificationEmail" source="*info*" starthoursago="24" | rex max_match=10 "send_to_email \[(?P&amp;lt;send_to_email&amp;gt;\S+)\]"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you want to match more than 10, just increase the &lt;CODE&gt;max_match&lt;/CODE&gt; value.&lt;/P&gt;

&lt;P&gt;Hope that helps.&lt;/P&gt;</description>
    <pubDate>Sat, 22 Jan 2011 01:05:56 GMT</pubDate>
    <dc:creator>Lamar</dc:creator>
    <dc:date>2011-01-22T01:05:56Z</dc:date>
    <item>
      <title>Linecount issue when searching logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Linecount-issue-when-searching-logs/m-p/30254#M178002</link>
      <description>&lt;P&gt;I have a question regarding a search I am trying to compose.&lt;/P&gt;

&lt;P&gt;Here is a snipped from the logs:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Tue Jan 18 13:50:01 UTC 2011
/opt/OXRS/blahblahblah/oxrs-flex/rpt
threshold check query succeeded at /opt/OXRS/INFO-CRON/oxrs-flex/rpt/rpt_send_notification_email.pl line 65.
Log DB handle successfully connected
send_to_email [support@dnottellingyou.com]
Inserting a record into the notification table
send_to_email [billing@nopetryagain.com]
Inserting a record into the notification table
send_to_email [heynow@heynow.com]
Inserting a record into the notification table
All done!
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;so, all i want out of this log is to know every time that send_to_email is printed in this logs.  that indicates an email went out.  I eventually want to get a count of all the emails went out, so counting send_to_email is the best option.  So far my search looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="Cron_SendNotificationEmail" source="*info*" starthoursago="24" send_to_email:
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have tried using the field extractor to make send_to_email a field, but it did not work out as expected.  I also tried making this an eventtype.  I was able to make send_to_email an eventtype so I could use it for searching, but then I noticed something.&lt;/P&gt;

&lt;P&gt;LINECOUNT!  I'm having issue with the linecount.  Meaning, splunk will find a log entry and only count finding send_to_email ONCE when right there in front of you in black and white you clearly see send_to_email 3 TIMES....but splunk only counts it as one "event"&lt;/P&gt;

&lt;P&gt;Case in point the example above splunk only sees as 1 event and only counts send_to_email once, not 3 times...&lt;/P&gt;

&lt;P&gt;How on earth do I fix this?  Do I have to use props.conf?  &lt;/P&gt;</description>
      <pubDate>Sat, 22 Jan 2011 00:07:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Linecount-issue-when-searching-logs/m-p/30254#M178002</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2011-01-22T00:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Linecount issue when searching logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Linecount-issue-when-searching-logs/m-p/30255#M178003</link>
      <description>&lt;P&gt;Sure, try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="Cron_SendNotificationEmail" source="*info*" starthoursago="24" | rex max_match=10 "send_to_email \[(?P&amp;lt;send_to_email&amp;gt;\S+)\]"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you want to match more than 10, just increase the &lt;CODE&gt;max_match&lt;/CODE&gt; value.&lt;/P&gt;

&lt;P&gt;Hope that helps.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jan 2011 01:05:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Linecount-issue-when-searching-logs/m-p/30255#M178003</guid>
      <dc:creator>Lamar</dc:creator>
      <dc:date>2011-01-22T01:05:56Z</dc:date>
    </item>
  </channel>
</rss>

