<?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: Splunk search regex how to?? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-regex-how-to/m-p/63252#M15629</link>
    <description>&lt;P&gt;Okay, the original question said that you wanted a regex that would extract a value. In Splunk terms, you are asking for a field: a field is defined by a regex and has a value based on what is extracted from the events. A regex that defines a field could be used with the &lt;CODE&gt;rex&lt;/CODE&gt; command, or it could be used with the interactive field extractor.&lt;/P&gt;

&lt;P&gt;If what you want is a &lt;EM&gt;search&lt;/EM&gt;, then you need to edit your question. What exactly do you want to accomplish? I am not sure now that you need to use a regular expression at all.&lt;/P&gt;</description>
    <pubDate>Fri, 14 Dec 2012 18:26:00 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2012-12-14T18:26:00Z</dc:date>
    <item>
      <title>Splunk search regex how to??</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-regex-how-to/m-p/63248#M15625</link>
      <description>&lt;P&gt;from this string 'op-failed', 'text': "[Errno 2] bad format", 'time': 1355388330.578211, 'error': 'fetch-error'}&lt;BR /&gt;
how can I extract the text between 'text' and  'time'?&lt;/P&gt;

&lt;P&gt;I'm looking for a regex that would return [Errno 2] bad format&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2012 19:49:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-regex-how-to/m-p/63248#M15625</guid>
      <dc:creator>hostedtower3</dc:creator>
      <dc:date>2012-12-13T19:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search regex how to??</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-regex-how-to/m-p/63249#M15626</link>
      <description>&lt;P&gt;This should do it&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;'text:'\s*"(?&amp;lt;errorText&amp;gt;.*?)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you need to put in the rex command, you could use&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\'text:\'\s*\"(?&amp;lt;errorText&amp;gt;.*?)\"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Otherwise the quotation marks may confuse the search parser.&lt;/P&gt;

&lt;P&gt;Note that the resulting field is named &lt;CODE&gt;errorText&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2012 21:09:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-regex-how-to/m-p/63249#M15626</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-12-13T21:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search regex how to??</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-regex-how-to/m-p/63250#M15627</link>
      <description>&lt;P&gt;How would the search query look like? (sorry I'm new to splunk)&lt;/P&gt;

&lt;P&gt;the source type is sourcetype="worker-stderr-*"&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2012 23:38:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-regex-how-to/m-p/63250#M15627</guid>
      <dc:creator>hostedtower3</dc:creator>
      <dc:date>2012-12-13T23:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search regex how to??</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-regex-how-to/m-p/63251#M15628</link>
      <description>&lt;P&gt;this search query returns 0 items&lt;BR /&gt;
&lt;CODE&gt;sourcetype="worker-stderr-*" op-failed | regex _raw=\'text:\'\s*\"(?&amp;lt;errorText&amp;gt;.*?)\"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;this search query returns 10 items&lt;BR /&gt;
&lt;CODE&gt;sourcetype="worker-stderr-*" op-failed&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;is this what you had in mind or am I missing something.&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 14 Dec 2012 00:17:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-regex-how-to/m-p/63251#M15628</guid>
      <dc:creator>hostedtower3</dc:creator>
      <dc:date>2012-12-14T00:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search regex how to??</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-regex-how-to/m-p/63252#M15629</link>
      <description>&lt;P&gt;Okay, the original question said that you wanted a regex that would extract a value. In Splunk terms, you are asking for a field: a field is defined by a regex and has a value based on what is extracted from the events. A regex that defines a field could be used with the &lt;CODE&gt;rex&lt;/CODE&gt; command, or it could be used with the interactive field extractor.&lt;/P&gt;

&lt;P&gt;If what you want is a &lt;EM&gt;search&lt;/EM&gt;, then you need to edit your question. What exactly do you want to accomplish? I am not sure now that you need to use a regular expression at all.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Dec 2012 18:26:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-regex-how-to/m-p/63252#M15629</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-12-14T18:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search regex how to??</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-regex-how-to/m-p/63253#M15630</link>
      <description>&lt;P&gt;You could do a &lt;EM&gt;search&lt;/EM&gt; like this&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetype="worker-stderr-*" op-failed "[Errno 2] bad format"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Dec 2012 18:27:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-regex-how-to/m-p/63253#M15630</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-12-14T18:27:21Z</dc:date>
    </item>
  </channel>
</rss>

