<?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: Pick up the first occurrence of a word in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359314#M174762</link>
    <description>&lt;P&gt;If the location of word ERROR (I'm assuming it's the one that appears after the timestamp) is the filter criteria, try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index1 ERROR | regex _raw="^\S+\s+ERROR.+"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 02 May 2017 18:29:46 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-05-02T18:29:46Z</dc:date>
    <item>
      <title>Pick up the first occurrence of a word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359307#M174755</link>
      <description>&lt;P&gt;I want to pick only the first occurrence of word .&lt;/P&gt;

&lt;P&gt;index = index1 ERROR &lt;/P&gt;

&lt;P&gt;Event Result&lt;/P&gt;

&lt;P&gt;2017-04-29T18:29:27.246+0000&lt;BR /&gt;
message test error &lt;BR /&gt;
testError&lt;BR /&gt;
requestURl="home/testError"&lt;/P&gt;

&lt;P&gt;But I am only interested the word Error, I thought i could with case insenstive search but it is not correct options or != operators this is may too dangerous might lose some other events&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 15:17:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359307#M174755</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-05-02T15:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: Pick up the first occurrence of a word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359308#M174756</link>
      <description>&lt;P&gt;Do you intend to perform case sensitive search? You can add the following to your base search &lt;CODE&gt;CASE("*Error")&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Search/UseCASEandTERMtomatchphrases"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Search/UseCASEandTERMtomatchphrases&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 15:24:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359308#M174756</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-05-02T15:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: Pick up the first occurrence of a word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359309#M174757</link>
      <description>&lt;P&gt;updated 8:00 PM CDT (Central US Daylight Savings TIme)&lt;/P&gt;

&lt;P&gt;This should select the first line that has the word "error" in any case, anywhere in the line in it.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index = index1 "ERROR"
| rex field=_raw "(?im)^(?&amp;lt;theline&amp;gt;.*error.*)$"
| table _time theline
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 May 2017 15:42:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359309#M174757</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-05-02T15:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: Pick up the first occurrence of a word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359310#M174758</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;

&lt;P&gt;it didnt work , getting error&lt;BR /&gt;
Error in 'SearchOperator:regex': Usage: regex  (=|!=) &lt;/P&gt;

&lt;P&gt;and ERROR is not a field&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 16:30:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359310#M174758</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-05-02T16:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Pick up the first occurrence of a word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359311#M174759</link>
      <description>&lt;P&gt;Sample Event Result 1: &lt;BR /&gt;
2017-04-15T19:19:51.669+0000 ERROR&lt;BR /&gt;
unknown error..........................&lt;BR /&gt;
ERROR&lt;BR /&gt;
....................................requestURI="url/test.error"&lt;BR /&gt;
.............something happened error&lt;/P&gt;

&lt;P&gt;I am interested only the very first appearance of the Error in the row data&lt;/P&gt;

&lt;P&gt;Not sure if it correct : getting actual result but it selects every error sample Event Result 1&lt;BR /&gt;
index= index1 ERROR |  regex _raw="\bERROR\b" &lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 16:45:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359311#M174759</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-05-02T16:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Pick up the first occurrence of a word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359312#M174760</link>
      <description>&lt;P&gt;not really,&lt;/P&gt;

&lt;P&gt;I am interested only in the first occurance of the word error and error is not a field.&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 17:06:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359312#M174760</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-05-02T17:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: Pick up the first occurrence of a word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359313#M174761</link>
      <description>&lt;P&gt;it would be helpful int the future&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 17:06:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359313#M174761</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-05-02T17:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: Pick up the first occurrence of a word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359314#M174762</link>
      <description>&lt;P&gt;If the location of word ERROR (I'm assuming it's the one that appears after the timestamp) is the filter criteria, try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index1 ERROR | regex _raw="^\S+\s+ERROR.+"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 May 2017 18:29:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359314#M174762</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-05-02T18:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: Pick up the first occurrence of a word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359315#M174763</link>
      <description>&lt;P&gt;corrected grammar, try again.&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 19:14:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359315#M174763</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-05-02T19:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Pick up the first occurrence of a word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359316#M174764</link>
      <description>&lt;P&gt;I think you've got what he means.  &lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 19:18:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359316#M174764</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-05-02T19:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Pick up the first occurrence of a word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359317#M174765</link>
      <description>&lt;P&gt;it works Thanks, but i'm interested only the first occurrence  for the word error but not the rest &lt;/P&gt;

&lt;P&gt;Log Sample &lt;/P&gt;

&lt;P&gt;Line 1 --&amp;gt; 2017-04-29T18:29:27.246+0000&lt;BR /&gt;
Line 2 -- &amp;gt;message test error &lt;BR /&gt;
Line 3 --&amp;gt; testError&lt;BR /&gt;
Line 4 --&amp;gt;requestURl="home/testError"&lt;/P&gt;

&lt;P&gt;Only want Line 2 Error which is the first appears of "ERROR"&lt;/P&gt;

&lt;P&gt;I used this command and it work but still i can see it select all error of the same event &lt;/P&gt;

&lt;P&gt;index = index1 "ERROR"&lt;BR /&gt;
 | regex _raw="\bError\b"&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 20:21:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359317#M174765</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-05-02T20:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Pick up the first occurrence of a word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359318#M174766</link>
      <description>&lt;P&gt;So do you've multiline events (field linecount&amp;gt;1)? If yes, then is there any rule that 'only select the events which has error word in line 2' or something similar? What should happen if instead of line 2 line 3 has word error?&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 20:28:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359318#M174766</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-05-02T20:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: Pick up the first occurrence of a word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359319#M174767</link>
      <description>&lt;P&gt;As soon as i see the error i want to stop, it doensn't matter it is in line 1,2 03, etc. it can any where the event. &lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 21:32:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359319#M174767</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-05-02T21:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Pick up the first occurrence of a word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359320#M174768</link>
      <description>&lt;P&gt;What you want to do after you picked that first Error word? You want to extract any field value around it? &lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 22:21:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359320#M174768</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-05-02T22:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Pick up the first occurrence of a word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359321#M174769</link>
      <description>&lt;P&gt;I dont want to extract to any field, but im interested the  whole _raw data &lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 00:29:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359321#M174769</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-05-03T00:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Pick up the first occurrence of a word</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359322#M174770</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index1 | rex field=requestURl \w+\/test(?&amp;lt;error&amp;gt;Error) | fields error
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 May 2017 04:38:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pick-up-the-first-occurrence-of-a-word/m-p/359322#M174770</guid>
      <dc:creator>danielsofoulis</dc:creator>
      <dc:date>2017-05-03T04:38:53Z</dc:date>
    </item>
  </channel>
</rss>

