<?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: eval lower command producing incorrect results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107605#M27973</link>
    <description>&lt;P&gt;Ok the first photo is the search using the eval command.  You can see from the field "inserting_a_record_" that there is only about 4 results.&lt;/P&gt;

&lt;P&gt;The second photo is when I removed the eval command and the results for "inserting_a_record" were correct.  There were in total 30 results for "inserting_a_record".&lt;/P&gt;

&lt;P&gt;I also tried removing the "max_match=1000" but this only produced about 15 results, which is only half.&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://i21.photobucket.com/albums/b288/photo_lady/picture1.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://i21.photobucket.com/albums/b288/photo_lady/picture2.png" alt="alt text" /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 10:05:12 GMT</pubDate>
    <dc:creator>gnovak</dc:creator>
    <dc:date>2020-09-28T10:05:12Z</dc:date>
    <item>
      <title>eval lower command producing incorrect results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107603#M27971</link>
      <description>&lt;P&gt;I have a search that will basically look through some logs for a line "Inserting a record" and then take the username &lt;STRONG&gt;after&lt;/STRONG&gt; this line and put it in a field called "inserting_a_record" for me.  I also created a workflow action for these usernames where I can click the drop down menu next to a username and select a link from the drop down menu to look up this username in a mailing list application.&lt;/P&gt;

&lt;P&gt;HOWEVER in the logs this username is displayed using capital letters.  I used "eval" to tell splunk to display it in lower case letters because in the third party application where I look up there usernames, they are listed in lower case letters.  Using capital letters yields no results so I had to make them lowercase.&lt;/P&gt;

&lt;P&gt;Here is the search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="Cron_CheckRegistrarThreshold" NOT host="*.bmp2.*" source="*asia*" earliest=-1d@d latest=-0d@d | rex "registrar username: \[(?P&amp;lt;inserting_a_record&amp;gt;\S+)\]\s*Inserting a record" max_match=1000 | search inserting_a_record="*" | eval inserting_a_record=lower(inserting_a_record)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;PROBLEM:  For some reason this search only displays 4 user names for me in the field "inserting_a_record".  However I know there are 30 usernames from looking at the log.  If I take away the | eval inserting_a_record=lower(inserting_a_record), I then receive the 30 usernames in the results.  The only problem is the usernames have uppercase letters and the workflow action wont' work.&lt;/P&gt;

&lt;P&gt;An example of one of these usernames is 5427-TU.  I use the eval command to make it display as 5427-tu.&lt;/P&gt;

&lt;P&gt;I have this same exact search with another type of log and it works perfectly but with this one, i'm not really sure why it's calculating the wrong numbers.&lt;/P&gt;

&lt;P&gt;Does anyone see anything obvious that sticks out?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 10:04:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107603#M27971</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2020-09-28T10:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: eval lower command producing incorrect results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107604#M27972</link>
      <description>&lt;P&gt;There are several places that you're restricting your results.  earliest/latest and max_match.  Verify that the data you're expecting is in that time and number of records range.  Better yet, post a sample of the data.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2011 23:24:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107604#M27972</guid>
      <dc:creator>Jon_Webster</dc:creator>
      <dc:date>2011-11-09T23:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: eval lower command producing incorrect results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107605#M27973</link>
      <description>&lt;P&gt;Ok the first photo is the search using the eval command.  You can see from the field "inserting_a_record_" that there is only about 4 results.&lt;/P&gt;

&lt;P&gt;The second photo is when I removed the eval command and the results for "inserting_a_record" were correct.  There were in total 30 results for "inserting_a_record".&lt;/P&gt;

&lt;P&gt;I also tried removing the "max_match=1000" but this only produced about 15 results, which is only half.&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://i21.photobucket.com/albums/b288/photo_lady/picture1.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://i21.photobucket.com/albums/b288/photo_lady/picture2.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 10:05:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107605#M27973</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2020-09-28T10:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: eval lower command producing incorrect results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107606#M27974</link>
      <description>&lt;P&gt;Here's an example of some of the text from the log.  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Wed Nov  9 23:45:01 UTC 2011
Both DB handles are connected
Resetting threshold count back to zero for registrars that have made a payment since the last run.
Threshold check query succeeded.
registrar username: [9345-NF]
Registrar has zero or negative balance but has been warned, cease emailing.
registrar username: [9715-MG]
Registrar has zero or negative balance but has been warned, cease emailing.
registrar username: [9153-WT]
Registrar has zero or negative balance but has been warned, cease emailing.
registrar username: [9643-IW]
Inserting a record into the notification table
Updating the registrar low threshold notification count
registrar username: [9875-NI]
Inserting a record into the notification table
Updating the registrar low threshold notification count
registrar username: [9879-NS]
Inserting a record into the notification table
Updating the registrar low threshold notification count
registrar username: [9338-HY]
Registrar has zero or negative balance but has been warned, cease emailing.
registrar username: [9175-ND]
Inserting a record into the notification table
Updating the registrar low threshold notification count
All done!
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Nov 2011 19:17:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107606#M27974</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2011-11-10T19:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: eval lower command producing incorrect results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107607#M27975</link>
      <description>&lt;P&gt;Just an FYI, you can always edit/revise your original question.  That is usually preferable to appending answers that provide additional information.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2011 19:27:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107607#M27975</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2011-11-10T19:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: eval lower command producing incorrect results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107608#M27976</link>
      <description>&lt;P&gt;oh sorry about that&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2011 20:43:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107608#M27976</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2011-11-10T20:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: eval lower command producing incorrect results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107609#M27977</link>
      <description>&lt;P&gt;anyone have any idea?  i just don't get why it's changing my answers.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2011 21:50:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107609#M27977</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2011-11-14T21:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: eval lower command producing incorrect results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107610#M27978</link>
      <description>&lt;P&gt;Is this just one event? Or do you break this into several events (in that case, how/where)?&lt;/P&gt;

&lt;P&gt;/k&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2011 09:35:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107610#M27978</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2011-11-15T09:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: eval lower command producing incorrect results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107611#M27979</link>
      <description>&lt;P&gt;It's several events, usually in a 24 hour period.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2011 16:24:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107611#M27979</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2011-11-15T16:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: eval lower command producing incorrect results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107612#M27980</link>
      <description>&lt;P&gt;could you please post a list of the events as they are indexed by splunk? E.g.&lt;/P&gt;

&lt;P&gt;Event #1&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;registrar username: [1111-AA]&lt;/P&gt;

&lt;P&gt;inserting a record into some table&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;Event #2&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;registrar username: [2222-BB]&lt;/P&gt;

&lt;P&gt;Updating something blah blah&lt;/P&gt;

&lt;HR /&gt;</description>
      <pubDate>Tue, 15 Nov 2011 16:30:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107612#M27980</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2011-11-15T16:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: eval lower command producing incorrect results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107613#M27981</link>
      <description>&lt;P&gt;I'm actually looking here:  &lt;A href="http://splunk-base.splunk.com/answers/2537/breaking-multiline-events"&gt;http://splunk-base.splunk.com/answers/2537/breaking-multiline-events&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;the example above of some of the log is 1 event. It's grouping everything together in one event...which i think is the problem.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2011 18:26:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107613#M27981</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2011-11-15T18:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: eval lower command producing incorrect results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107614#M27982</link>
      <description>&lt;P&gt;This search worked. I just added the table command and for some reason all the results are now displayed.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="Cron_CheckRegistrarThreshold" NOT host=".bmp2." source="asia" earliest=-1d@d latest=-0d@d | rex "registrar username: [(?P&amp;lt;inserting_a_record&amp;gt;S+)]sInserting a record" max_match=1000 | search inserting_a_record="" | table "registrar username" inserting_a_record | eval inserting_a_record=lower(inserting_a_record)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However from doing this there are more results now...like empty lines or lines containing fields I don't want. This might not be the best solution but I'm experimenting with it.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2011 19:42:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107614#M27982</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2011-11-15T19:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: eval lower command producing incorrect results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107615#M27983</link>
      <description>&lt;P&gt;I think that some (if not all) of these oddities you are experiencing are due to the fact that the log data coming in is formatted the way it is, e.g. there are no timestamps or similar to separate the events from each other. &lt;/P&gt;

&lt;P&gt;It seems that splunk interprets all of your log events as single event. In my experience this makes the field extractions harder, since there will be multiple values for "username".&lt;/P&gt;

&lt;P&gt;Somebody more skilled in multi-value stuff will have to take over from here.&lt;/P&gt;

&lt;P&gt;Sorry, &lt;/P&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2011 20:39:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107615#M27983</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2011-11-15T20:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: eval lower command producing incorrect results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107616#M27984</link>
      <description>&lt;P&gt;This finally worked...sourcetype="Cron_CheckRegistrarThreshold" NOT host="&lt;EM&gt;.bmp2.&lt;/EM&gt;" source="&lt;EM&gt;asia&lt;/EM&gt;" earliest=-1d@d latest=-0d@d | rex "registrar username: [(?P&lt;RAW_INSERTING_A_RECORD&gt;\S+)]\s*Inserting a record" max_match=1000 | search raw_inserting_a_record="*" | eval inserting_a_record=split(lower(mvjoin(raw_inserting_a_record,";")),";")&lt;/RAW_INSERTING_A_RECORD&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 10:06:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-lower-command-producing-incorrect-results/m-p/107616#M27984</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2020-09-28T10:06:38Z</dc:date>
    </item>
  </channel>
</rss>

