<?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: fomation in pattern matching- please help urgently in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/fomation-in-pattern-matching-please-help-urgently/m-p/104910#M27194</link>
    <description>&lt;P&gt;my rex is absoutely working fine separately for each keyword,when I am giving it ( kol | delhi ) it is not mathing everything, More over this is not my question , My question is very well defined in my first post but I am still un-answered, I am seeking for the value 0 if my keyword is not matching with the field ( that is my question that how to get 0 count )&lt;/P&gt;</description>
    <pubDate>Mon, 29 Oct 2012 18:23:10 GMT</pubDate>
    <dc:creator>abhayneilam</dc:creator>
    <dc:date>2012-10-29T18:23:10Z</dc:date>
    <item>
      <title>fomation in pattern matching- please help urgently</title>
      <link>https://community.splunk.com/t5/Splunk-Search/fomation-in-pattern-matching-please-help-urgently/m-p/104902#M27186</link>
      <description>&lt;P&gt;I have 2 keywords and I am running query :&lt;/P&gt;

&lt;P&gt;index="maa" | table Name Age Location | rex field="Location" (?&lt;ONE&gt;(?i)"kol") | eval ONE=lower(ONE) |stats count(ONE) by ONE | append [ search index="maa" | table Name Age Location | rex field="Location" (?&lt;ONE&gt;(?i)"delhi") | eval ONE=lower(ONE) |stats count(ONE) by ONE ]&lt;/ONE&gt;&lt;/ONE&gt;&lt;/P&gt;

&lt;P&gt;Out of two keywords ( kol,delhi), Location field is matching only "kol" keyword and I am getting my output as :&lt;/P&gt;

&lt;P&gt;kol    10&lt;BR /&gt;
but I want to get my output as&lt;/P&gt;

&lt;P&gt;kol     10&lt;BR /&gt;
delhi    0&lt;/P&gt;

&lt;P&gt;because if there is no match then it should print 0 along with the keyword as above&lt;/P&gt;

&lt;P&gt;Please help me to get the output, if pattern doesnot match, it should print 0 along with the pattern ( 0 will represent that  there is not such pattern ) &lt;/P&gt;

&lt;P&gt;Please help !! this is really urgent &lt;/P&gt;</description>
      <pubDate>Sat, 27 Oct 2012 17:00:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/fomation-in-pattern-matching-please-help-urgently/m-p/104902#M27186</guid>
      <dc:creator>abhayneilam</dc:creator>
      <dc:date>2012-10-27T17:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: fomation in pattern matching- please help urgently</title>
      <link>https://community.splunk.com/t5/Splunk-Search/fomation-in-pattern-matching-please-help-urgently/m-p/104903#M27187</link>
      <description>&lt;P&gt;&lt;A href="http://splunk-base.splunk.com/answers/62196/any-way-to-return-zero-result-count-stats-of-a-field-such-as-the-host-or-sourcteype-field?page=1&amp;amp;focusedAnswerId=62594#62594"&gt;http://splunk-base.splunk.com/answers/62196/any-way-to-return-zero-result-count-stats-of-a-field-such-as-the-host-or-sourcteype-field?page=1&amp;amp;focusedAnswerId=62594#62594&lt;/A&gt; may help&lt;/P&gt;</description>
      <pubDate>Sat, 27 Oct 2012 18:20:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/fomation-in-pattern-matching-please-help-urgently/m-p/104903#M27187</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2012-10-27T18:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: fomation in pattern matching- please help urgently</title>
      <link>https://community.splunk.com/t5/Splunk-Search/fomation-in-pattern-matching-please-help-urgently/m-p/104904#M27188</link>
      <description>&lt;P&gt;Thanks gkanapathy for this link : &lt;/P&gt;

&lt;P&gt;But I am getting a bit confused with the ans given to this link : &lt;/P&gt;

&lt;P&gt;Could you please ( its heartly request ) help me to my query  :&lt;/P&gt;

&lt;P&gt;index="maa" | table Name Age Location | rex field="Location" (?&lt;ONE&gt;(?i)"kol") | eval ONE=lower(ONE) |stats count(ONE) by ONE | append [ search index="maa" | table Name Age Location | rex field="Location" (?&lt;ONE&gt;(?i)"delhi") | eval ONE=lower(ONE) |stats count(ONE) by ONE ]&lt;/ONE&gt;&lt;/ONE&gt;&lt;/P&gt;

&lt;P&gt;please help me if any of the keyword is not matching the field "Location" then it should display the keyword along with 0..&lt;/P&gt;

&lt;P&gt;Thanks in Advance !! Please&lt;/P&gt;</description>
      <pubDate>Sat, 27 Oct 2012 19:03:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/fomation-in-pattern-matching-please-help-urgently/m-p/104904#M27188</guid>
      <dc:creator>abhayneilam</dc:creator>
      <dc:date>2012-10-27T19:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: fomation in pattern matching- please help urgently</title>
      <link>https://community.splunk.com/t5/Splunk-Search/fomation-in-pattern-matching-please-help-urgently/m-p/104905#M27189</link>
      <description>&lt;P&gt;Fields names are case sensitive. Please be consistent in your usage. ( don't use one then ONE)&lt;/P&gt;</description>
      <pubDate>Sun, 28 Oct 2012 14:31:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/fomation-in-pattern-matching-please-help-urgently/m-p/104905#M27189</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2012-10-28T14:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: fomation in pattern matching- please help urgently</title>
      <link>https://community.splunk.com/t5/Splunk-Search/fomation-in-pattern-matching-please-help-urgently/m-p/104906#M27190</link>
      <description>&lt;P&gt;By mistaken I have used "one" instead of "ONE"&lt;/P&gt;

&lt;P&gt;index="maa" | table Name Age Location | rex field="Location" (?&lt;ONE&gt;(?i)"kol") | eval ONE=lower(ONE) |stats count(ONE) by ONE | append [ search index="maa" | table Name Age Location | rex field="Location" (?&lt;ONE&gt;(?i)"delhi") | eval ONE=lower(ONE) |stats count(ONE) by ONE ]&lt;/ONE&gt;&lt;/ONE&gt;&lt;/P&gt;

&lt;P&gt;Above is  my query now let me know how do i proceed&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2012 05:04:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/fomation-in-pattern-matching-please-help-urgently/m-p/104906#M27190</guid>
      <dc:creator>abhayneilam</dc:creator>
      <dc:date>2012-10-29T05:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: fomation in pattern matching- please help urgently</title>
      <link>https://community.splunk.com/t5/Splunk-Search/fomation-in-pattern-matching-please-help-urgently/m-p/104907#M27191</link>
      <description>&lt;P&gt;You still mix one and ONE. Proceed by fixing that.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2012 05:37:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/fomation-in-pattern-matching-please-help-urgently/m-p/104907#M27191</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-10-29T05:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: fomation in pattern matching- please help urgently</title>
      <link>https://community.splunk.com/t5/Splunk-Search/fomation-in-pattern-matching-please-help-urgently/m-p/104908#M27192</link>
      <description>&lt;P&gt;index="maa" | table Name Age Location | rex field="Location" (?&lt;ONE&gt;(?i)"kol") | eval one=lower(one) |stats count(one) by one | append [ search index="maa" | table Name Age Location | rex field="Location" (?&lt;ONE&gt;(?i)"delhi") | eval one=lower(one) |stats count(one) by one ]&lt;/ONE&gt;&lt;/ONE&gt;&lt;/P&gt;

&lt;P&gt;Now, Please help me to get the solution&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2012 09:43:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/fomation-in-pattern-matching-please-help-urgently/m-p/104908#M27192</guid>
      <dc:creator>abhayneilam</dc:creator>
      <dc:date>2012-10-29T09:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: fomation in pattern matching- please help urgently</title>
      <link>https://community.splunk.com/t5/Splunk-Search/fomation-in-pattern-matching-please-help-urgently/m-p/104909#M27193</link>
      <description>&lt;P&gt;Without any sample we cannot test your search.&lt;/P&gt;

&lt;P&gt;If your events contains a single value in the field Location, you probably don't need 2 searches, a single one can do the trick.&lt;BR /&gt;
Also I don't know if your regex is supposed to match "kol" or kol.&lt;BR /&gt;
Also, the rex command expect &lt;CODE&gt;| rex field=namofthefield "regexexpression"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;example :&lt;/P&gt;

&lt;PRE&gt;index="maa"  kol OR delhi 
| table Name Age Location 
| rex field=Location "(?&lt;ONE&gt;(?i)kol|delhi)"
| eval one=lower(one) 
|stats count(one) by one
&lt;/ONE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Oct 2012 17:05:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/fomation-in-pattern-matching-please-help-urgently/m-p/104909#M27193</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2012-10-29T17:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: fomation in pattern matching- please help urgently</title>
      <link>https://community.splunk.com/t5/Splunk-Search/fomation-in-pattern-matching-please-help-urgently/m-p/104910#M27194</link>
      <description>&lt;P&gt;my rex is absoutely working fine separately for each keyword,when I am giving it ( kol | delhi ) it is not mathing everything, More over this is not my question , My question is very well defined in my first post but I am still un-answered, I am seeking for the value 0 if my keyword is not matching with the field ( that is my question that how to get 0 count )&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2012 18:23:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/fomation-in-pattern-matching-please-help-urgently/m-p/104910#M27194</guid>
      <dc:creator>abhayneilam</dc:creator>
      <dc:date>2012-10-29T18:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: fomation in pattern matching- please help urgently</title>
      <link>https://community.splunk.com/t5/Splunk-Search/fomation-in-pattern-matching-please-help-urgently/m-p/104911#M27195</link>
      <description>&lt;P&gt;ok,if the second sub search doesn't return any result, then there will be nothing to append and splunk will not display it.&lt;/P&gt;

&lt;P&gt;The workaround for this is to write a list of your expected lines, and store them in a csv file or a lookup&lt;BR /&gt;
example file city_list.csv with a column header. &lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
city, country&lt;BR /&gt;
delhi, india&lt;BR /&gt;
kol, india&lt;BR /&gt;
moscow,russia&lt;BR /&gt;
&lt;/PRE&gt;&lt;BR /&gt;
you can upload the file with the manager, or generate the file with the result of a search (see outputloookup)&lt;/P&gt;

&lt;P&gt;Then during your search use a OUTER JOIN on the city name to match the list to your results, and at the very end, replace the missing values per "zero"&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;mysupersearch &lt;BR /&gt;
| table city count &lt;BR /&gt;
| JOIN type=outer city [ search inpulookup city_list.csv | table city ] &lt;BR /&gt;
| table city count &lt;BR /&gt;
| fillnull count value="0"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;for details :&lt;/P&gt;

&lt;P&gt;lookups &lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.4/SearchReference/Inputlookup"&gt;http://docs.splunk.com/Documentation/Splunk/4.3.4/SearchReference/Inputlookup&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.4/SearchReference/Outputlookup"&gt;http://docs.splunk.com/Documentation/Splunk/4.3.4/SearchReference/Outputlookup&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Aboutlookupsandfieldactions"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Aboutlookupsandfieldactions&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;join  &lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.4/SearchReference/Join"&gt;http://docs.splunk.com/Documentation/Splunk/4.3.4/SearchReference/Join&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2012 18:40:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/fomation-in-pattern-matching-please-help-urgently/m-p/104911#M27195</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2012-10-29T18:40:40Z</dc:date>
    </item>
  </channel>
</rss>

