<?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: regex TEXT in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22948#M4009</link>
    <description>&lt;P&gt;I tried dwaddle's solution on my data and it worked fine.  You are piping to rex, and not regex as you say in your title and first comment, correct?  No newlines in your data?  Does it make a difference if you specify field=&lt;YOURFIELD&gt; to rex?&lt;/YOURFIELD&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Apr 2012 21:09:11 GMT</pubDate>
    <dc:creator>cphair</dc:creator>
    <dc:date>2012-04-10T21:09:11Z</dc:date>
    <item>
      <title>regex TEXT</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22939#M4000</link>
      <description>&lt;P&gt;Hopufully a quick one but I'm looking to search and extract anything between two these fields &lt;TITLE&gt;TEXT&lt;/TITLE&gt; anyone know how?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2012 01:19:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22939#M4000</guid>
      <dc:creator>tb582</dc:creator>
      <dc:date>2012-04-10T01:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: regex TEXT</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22940#M4001</link>
      <description>&lt;P&gt;The extraction is simple:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "&amp;lt;title&amp;gt;(?&amp;lt;title_text&amp;gt;.*)&amp;lt;/title&amp;gt;"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The searching part I'll leave as an exercise...&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2012 01:52:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22940#M4001</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2012-04-10T01:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: regex TEXT</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22941#M4002</link>
      <description>&lt;P&gt;Great Thanks, but I seem to be returning a huge line as theres a bunch of tags such as &lt;TYPE&gt;TEXT&lt;/TYPE&gt;&lt;OWNER&gt;TEXT&lt;OWNER&gt;&lt;TITLE&gt;TEXT&lt;/TITLE&gt; how do I limit it only to the text between the tags that I'm looking for? my search is "&lt;TITLE&gt;" | regex ...&lt;/TITLE&gt;&lt;/OWNER&gt;&lt;/OWNER&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2012 02:30:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22941#M4002</guid>
      <dc:creator>tb582</dc:creator>
      <dc:date>2012-04-10T02:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: regex TEXT</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22942#M4003</link>
      <description>&lt;P&gt;| table title_text&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2012 06:04:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22942#M4003</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-04-10T06:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: regex TEXT</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22943#M4004</link>
      <description>&lt;P&gt;its still giving me the entire line and not just whats between the &lt;TITLE&gt;&lt;/TITLE&gt; tags.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2012 12:42:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22943#M4004</guid>
      <dc:creator>tb5821</dc:creator>
      <dc:date>2012-04-10T12:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: regex TEXT</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22944#M4005</link>
      <description>&lt;P&gt;Do you have multiple &lt;CODE&gt;&amp;lt;title&amp;gt;&lt;/CODE&gt; tags for some weird reason? In that case, you will want to make the regex match non-greedy:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "&amp;lt;title&amp;gt;(?&amp;lt;title_text&amp;gt;.*?)&amp;lt;/title&amp;gt;"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Apr 2012 12:57:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22944#M4005</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-04-10T12:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: regex TEXT</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22945#M4006</link>
      <description>&lt;P&gt;No, there's only one set of title tags but its all contained within one long line that has other tags.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2012 14:12:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22945#M4006</guid>
      <dc:creator>tb5821</dc:creator>
      <dc:date>2012-04-10T14:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: regex TEXT</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22946#M4007</link>
      <description>&lt;P&gt;And you applied the table command I wrote at the end of your search?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2012 14:20:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22946#M4007</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-04-10T14:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: regex TEXT</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22947#M4008</link>
      <description>&lt;P&gt;Yes, and in the table I get the entire line...&lt;/P&gt;

&lt;P&gt;Mytitle&lt;AUTHOR&gt;test&lt;/AUTHOR&gt;&lt;DESCRIPTION&gt;A doctor.&lt;/DESCRIPTION&gt;&lt;COPYRIGHT&gt;My copy&lt;/COPYRIGHT&gt;&lt;RATING&gt;TV-MA&lt;/RATING&gt;&lt;OWNER&gt;my owner&lt;/OWNER&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2012 14:28:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22947#M4008</guid>
      <dc:creator>tb5821</dc:creator>
      <dc:date>2012-04-10T14:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: regex TEXT</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22948#M4009</link>
      <description>&lt;P&gt;I tried dwaddle's solution on my data and it worked fine.  You are piping to rex, and not regex as you say in your title and first comment, correct?  No newlines in your data?  Does it make a difference if you specify field=&lt;YOURFIELD&gt; to rex?&lt;/YOURFIELD&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2012 21:09:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22948#M4009</guid>
      <dc:creator>cphair</dc:creator>
      <dc:date>2012-04-10T21:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: regex TEXT</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22949#M4010</link>
      <description>&lt;P&gt;Correct, I'm using rex not sure what you mean by field=&lt;YOURFIELD&gt; since its just a string and not an actual extracted field&lt;/YOURFIELD&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2012 02:10:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22949#M4010</guid>
      <dc:creator>tb582</dc:creator>
      <dc:date>2012-04-11T02:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: regex TEXT</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22950#M4011</link>
      <description>&lt;P&gt;As both cphair and me have tried these suggestions ourselves with the expected results I think it would be a good idea for you to paste a sample event. With the rex and table commands at the end, you really should be seeing only what's between the title opening and closing tags.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2012 05:31:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22950#M4011</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-04-11T05:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: regex TEXT</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22951#M4012</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=myindex sourcetype=my-app host=04* OR host=050 Status_type="ERROR" NOT "The remote server returned an error: (401) Unauthorized." | join type=left task_id [search iindex=myindex sourcetype=my-app host=04* OR host=050 "&amp;lt;title&amp;gt;" OR "&amp;lt;owner&amp;gt;" rex "&amp;lt;title&amp;gt;(?&amp;lt;title_text&amp;gt;.*)&amp;lt;/title&amp;gt;" | rex "&amp;lt;owner&amp;gt;(?&amp;lt;owner_text&amp;gt;.*)&amp;lt;/owner&amp;gt;" | rename id AS "Asset" | fields "Asset" task_id owner_text title_text]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Apr 2012 12:59:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22951#M4012</guid>
      <dc:creator>tb5821</dc:creator>
      <dc:date>2012-04-11T12:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: regex TEXT</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22952#M4013</link>
      <description>&lt;P&gt;Not sure if the forum mangled your syntax, but you're missing a pipe character between OR "&lt;OWNER&gt;" and the first rex.  Also, wouldn't a where command work better than a join on a subsearch?  Something like "where NOT like(status_type, "(401) Unauthorized".&lt;/OWNER&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2012 13:09:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22952#M4013</guid>
      <dc:creator>cphair</dc:creator>
      <dc:date>2012-04-11T13:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: regex TEXT</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22953#M4014</link>
      <description>&lt;P&gt;sorry, that pipe should of been included in the post.&lt;/P&gt;

&lt;P&gt;Not sure if a where would be better, I'm new to splunk &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2012 13:20:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22953#M4014</guid>
      <dc:creator>tb5821</dc:creator>
      <dc:date>2012-04-11T13:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: regex TEXT</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22954#M4015</link>
      <description>&lt;P&gt;So where's the &lt;CODE&gt;| table&lt;/CODE&gt; command that you reportedly were using?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2012 13:29:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22954#M4015</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-04-11T13:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: regex TEXT</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22955#M4016</link>
      <description>&lt;P&gt;It may be the join that's messing you up.  Try it without the subsearch:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
index=myindex sourcetype=my-app host=04 OR host=050 Status_type="ERROR" NOT "The remote server returned an error: (401) Unauthorized." | rex "&lt;TITLE&gt;(?&amp;lt;title_text&amp;gt;.)&lt;/TITLE&gt;" | rex "&lt;OWNER&gt;(?&lt;OWNER_TEXT&gt;.)&lt;/OWNER_TEXT&gt;" | rename id AS "Asset" | table "Asset" task_id owner_text title_text &lt;BR /&gt;
&lt;/OWNER&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;
Since you're doing a left join anyway, you're keeping all the results from the original search, so you don't have to do another search over the same data cut.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:39:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22955#M4016</guid>
      <dc:creator>cphair</dc:creator>
      <dc:date>2020-09-28T11:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: regex TEXT</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22956#M4017</link>
      <description>&lt;P&gt;I took it out to see if it made a difference... it would look like so at the very end ... | table task_id owner_text title_text&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:39:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22956#M4017</guid>
      <dc:creator>tb5821</dc:creator>
      <dc:date>2020-09-28T11:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: regex TEXT</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22957#M4018</link>
      <description>&lt;P&gt;Well it's not going to do much good within a subsearch. You need to add it to your main search.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2012 14:06:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-TEXT/m-p/22957#M4018</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-04-11T14:06:55Z</dc:date>
    </item>
  </channel>
</rss>

