<?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: Easy way to match just the beginning of a field value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Easy-way-to-match-just-the-beginning-of-a-field-value/m-p/196719#M56785</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;Bought OR Sold | rex "(?&amp;lt;transaction&amp;gt;Bought|Sold[^ ]+)" | timechart span=1h count by transaction
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 11 Jun 2014 21:20:04 GMT</pubDate>
    <dc:creator>the_wolverine</dc:creator>
    <dc:date>2014-06-11T21:20:04Z</dc:date>
    <item>
      <title>Easy way to match just the beginning of a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Easy-way-to-match-just-the-beginning-of-a-field-value/m-p/196717#M56783</link>
      <description>&lt;P&gt;Hi Folks,&lt;/P&gt;

&lt;P&gt;I'm having a hard time working around using a wildcard within an eval, which isn't possible as far as I know.&lt;/P&gt;

&lt;P&gt;Say I have these field values:&lt;BR /&gt;
Bought an orange&lt;BR /&gt;
Bought a banana&lt;BR /&gt;
Bought a cantelope&lt;BR /&gt;
Sold a monkey&lt;BR /&gt;
Sold an elephant&lt;BR /&gt;
Bought a lion&lt;/P&gt;

&lt;P&gt;I want to count, simply, how many times "Bought" show up, and how many times "Sold" show up, so I can chart them.&lt;/P&gt;

&lt;P&gt;Eval statements prevent wildcards, so I can't think of what to use. Is there a simple method of doing this? &lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2014 20:56:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Easy-way-to-match-just-the-beginning-of-a-field-value/m-p/196717#M56783</guid>
      <dc:creator>jravida</dc:creator>
      <dc:date>2014-06-11T20:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Easy way to match just the beginning of a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Easy-way-to-match-just-the-beginning-of-a-field-value/m-p/196718#M56784</link>
      <description>&lt;P&gt;Eval does except wildcard ('%') for the function 'like'. Try below expression&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | stats count(eval(like(yourfield,"Bought %"))) BoughtCount count(eval(like(yourfield,"Sold %"))) SoldCount
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Jun 2014 21:13:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Easy-way-to-match-just-the-beginning-of-a-field-value/m-p/196718#M56784</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-06-11T21:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: Easy way to match just the beginning of a field value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Easy-way-to-match-just-the-beginning-of-a-field-value/m-p/196719#M56785</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;Bought OR Sold | rex "(?&amp;lt;transaction&amp;gt;Bought|Sold[^ ]+)" | timechart span=1h count by transaction
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Jun 2014 21:20:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Easy-way-to-match-just-the-beginning-of-a-field-value/m-p/196719#M56785</guid>
      <dc:creator>the_wolverine</dc:creator>
      <dc:date>2014-06-11T21:20:04Z</dc:date>
    </item>
  </channel>
</rss>

