<?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 certain value from a field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-certain-value-from-a-field/m-p/461985#M130238</link>
    <description>&lt;P&gt;Thanks a bunch, really appreciate it. This works well!&lt;/P&gt;</description>
    <pubDate>Thu, 02 Apr 2020 10:50:43 GMT</pubDate>
    <dc:creator>timyong80</dc:creator>
    <dc:date>2020-04-02T10:50:43Z</dc:date>
    <item>
      <title>Regex certain value from a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-certain-value-from-a-field/m-p/461978#M130231</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have a regex question. I have a field called "Container" and below are the examples of the values.&lt;BR /&gt;
I would like to regex a certain part of the value but unfortunately, there's no unique marker to tell it where to start/stop. However, I noticed that there's always 3 underscores before that specific part that I need to extract so probably that could be helpful for the regex.&lt;/P&gt;

&lt;P&gt;Can you help me with the regex expression (starts after the 3rd underscore and ends before the next underscore)?&lt;/P&gt;

&lt;P&gt;1) k8s_jenkins_jenkins-16-mrlz4_tau-ops_eb099c1d-6d70-11ea-8ba8-001a4a160104_0&lt;BR /&gt;
2) k8s_datadog-agent_datadog-agent-t4dlc_clusteradmin_dd5f238b-6a16-11ea-8ef9-566f4e1c0167_351&lt;BR /&gt;
3) k8s_core-order-service_core-order-service-deployment-1-t9b29_fltc-ods-uit_b10cf94d-64b1-11ea-8ef9-566f4e1c0167_3513&lt;/P&gt;

&lt;P&gt;Desired regex result for Container field:&lt;/P&gt;

&lt;P&gt;1) tau-ops&lt;BR /&gt;
2) clusteradmin&lt;BR /&gt;
3) fltc-ods-uit&lt;/P&gt;

&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:47:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-certain-value-from-a-field/m-p/461978#M130231</guid>
      <dc:creator>timyong80</dc:creator>
      <dc:date>2020-09-30T04:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Regex certain value from a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-certain-value-from-a-field/m-p/461979#M130232</link>
      <description>&lt;P&gt;Here is one way to do it, using a Run Anywhere SPL:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw="event
k8s_jenkins_jenkins-16-mrlz4_tau-ops_eb099c1d-6d70-11ea-8ba8-001a4a160104_0
k8s_datadog-agent_datadog-agent-t4dlc_clusteradmin_dd5f238b-6a16-11ea-8ef9-566f4e1c0167_351
k8s_core-order-service_core-order-service-deployment-1-t9b29_fltc-ods-uit_b10cf94d-64b1-11ea-8ef9-566f4e1c0167_3513"
| multikv forceheader=1 | fields _raw
| rex "(.*?_){3}(?&amp;lt;container&amp;gt;[^_]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See &lt;A href="https://regex101.com/r/ZucO5K/1"&gt;regex101&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 12:31:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-certain-value-from-a-field/m-p/461979#M130232</guid>
      <dc:creator>jpolvino</dc:creator>
      <dc:date>2020-03-31T12:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Regex certain value from a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-certain-value-from-a-field/m-p/461980#M130233</link>
      <description>&lt;P&gt;Hi @timyong80,&lt;BR /&gt;
please try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=your_index
| rex "^([^_]+_){3}(?&amp;lt;field&amp;gt;[^_]+)_"
| ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;that you can test at &lt;A href="https://regex101.com/r/CCGPg6/1"&gt;https://regex101.com/r/CCGPg6/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 12:32:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-certain-value-from-a-field/m-p/461980#M130233</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-03-31T12:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Regex certain value from a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-certain-value-from-a-field/m-p/461981#M130234</link>
      <description>&lt;P&gt;This works with your sample data.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=Container "(?:[^_]+_){3}(?&amp;lt;field&amp;gt;[^_]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Mar 2020 12:38:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-certain-value-from-a-field/m-p/461981#M130234</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-03-31T12:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: Regex certain value from a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-certain-value-from-a-field/m-p/461982#M130235</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Check this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval Container="k8s_jenkins_jenkins-16-mrlz4_tau-ops_eb099c1d-6d70-11ea-8ba8-001a4a160104_0,
 k8s_datadog-agent_datadog-agent-t4dlc_clusteradmin_dd5f238b-6a16-11ea-8ef9-566f4e1c0167_351,
 k8s_core-order-service_core-order-service-deployment-1-t9b29_fltc-ods-uit_b10cf94d-64b1-11ea-8ef9-566f4e1c0167_3513" 
| makemv delim="," Container 
| mvexpand Container 
| eval result = mvindex(split(Container,"_"),3) 
| table Container,result
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Mar 2020 12:46:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-certain-value-from-a-field/m-p/461982#M130235</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2020-03-31T12:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Regex certain value from a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-certain-value-from-a-field/m-p/461983#M130236</link>
      <description>&lt;P&gt;Excellent, I used the rex part only and it works! &lt;BR /&gt;
Thank you very much&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2020 10:49:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-certain-value-from-a-field/m-p/461983#M130236</guid>
      <dc:creator>timyong80</dc:creator>
      <dc:date>2020-04-02T10:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: Regex certain value from a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-certain-value-from-a-field/m-p/461984#M130237</link>
      <description>&lt;P&gt;Thanks a lot &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; This works!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2020 10:50:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-certain-value-from-a-field/m-p/461984#M130237</guid>
      <dc:creator>timyong80</dc:creator>
      <dc:date>2020-04-02T10:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: Regex certain value from a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-certain-value-from-a-field/m-p/461985#M130238</link>
      <description>&lt;P&gt;Thanks a bunch, really appreciate it. This works well!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2020 10:50:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-certain-value-from-a-field/m-p/461985#M130238</guid>
      <dc:creator>timyong80</dc:creator>
      <dc:date>2020-04-02T10:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Regex certain value from a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-certain-value-from-a-field/m-p/461986#M130239</link>
      <description>&lt;P&gt;Thank you! These are 3 separate entries actually., not in one field separated by comma. &lt;BR /&gt;
But I learned new thing about makemv delim function. Thanks again! &lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2020 10:53:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-certain-value-from-a-field/m-p/461986#M130239</guid>
      <dc:creator>timyong80</dc:creator>
      <dc:date>2020-04-02T10:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Regex certain value from a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-certain-value-from-a-field/m-p/461987#M130240</link>
      <description>&lt;P&gt;Hi @timyong80,&lt;BR /&gt;
you're welcome!&lt;BR /&gt;
Ciao and next time!&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2020 12:25:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-certain-value-from-a-field/m-p/461987#M130240</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-04-02T12:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Regex certain value from a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-certain-value-from-a-field/m-p/461988#M130241</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;How can I regex &lt;CODE&gt;&amp;lt;Type&amp;gt; Read Only &amp;lt;/Type&amp;gt;&lt;/CODE&gt; to get "Read Only"? I mean only yield text between the tags.&lt;/P&gt;

&lt;P&gt;Thanks, &lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2020 13:37:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-certain-value-from-a-field/m-p/461988#M130241</guid>
      <dc:creator>vnguyen46</dc:creator>
      <dc:date>2020-04-02T13:37:54Z</dc:date>
    </item>
  </channel>
</rss>

