<?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: How to search for part of a string matching a certain regex for an ID in a text field and replace it with &amp;quot;id&amp;quot;? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-part-of-a-string-matching-a-certain-regex-for/m-p/202460#M58744</link>
    <description>&lt;P&gt;It's numeric or alfa-numberic with special structure&lt;/P&gt;</description>
    <pubDate>Wed, 07 Oct 2015 17:44:48 GMT</pubDate>
    <dc:creator>0range</dc:creator>
    <dc:date>2015-10-07T17:44:48Z</dc:date>
    <item>
      <title>How to search for part of a string matching a certain regex for an ID in a text field and replace it with "id"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-part-of-a-string-matching-a-certain-regex-for/m-p/202455#M58739</link>
      <description>&lt;P&gt;Hello everyone.&lt;/P&gt;

&lt;P&gt;I need to substitute text "id" in text fields where I have ids now: like 123123123, 312asda-adas2 and so one.&lt;/P&gt;

&lt;P&gt;For example, I need these transformations:&lt;BR /&gt;
&lt;CODE&gt;/bar/1233131/foo&lt;/CODE&gt; -&amp;gt; &lt;CODE&gt;/bar/id/foo&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;/bar/12313&lt;/CODE&gt; -&amp;gt; &lt;CODE&gt;/bar/id&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;/foo/a2b-b2a/bar&lt;/CODE&gt; -&amp;gt; &lt;CODE&gt;/foo/id/bar&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;How can I do it in Splunk?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2015 09:18:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-part-of-a-string-matching-a-certain-regex-for/m-p/202455#M58739</guid>
      <dc:creator>0range</dc:creator>
      <dc:date>2015-09-01T09:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for part of a string matching a certain regex for an ID in a text field and replace it with "id"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-part-of-a-string-matching-a-certain-regex-for/m-p/202456#M58740</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=text mode=sed "s/(\/.*?\/)([^\/]*)($|\/.*)/\1id\3/" | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Sep 2015 12:25:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-part-of-a-string-matching-a-certain-regex-for/m-p/202456#M58740</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-09-01T12:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for part of a string matching a certain regex for an ID in a text field and replace it with "id"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-part-of-a-string-matching-a-certain-regex-for/m-p/202457#M58741</link>
      <description>&lt;P&gt;Is the ID you're looking to substitute always just two directories deep?  Or can it be 3, 4, 5+ sub-directories deep?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2015 13:14:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-part-of-a-string-matching-a-certain-regex-for/m-p/202457#M58741</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2015-09-01T13:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for part of a string matching a certain regex for an ID in a text field and replace it with "id"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-part-of-a-string-matching-a-certain-regex-for/m-p/202458#M58742</link>
      <description>&lt;P&gt;In general, it can be at any level &lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2015 07:18:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-part-of-a-string-matching-a-certain-regex-for/m-p/202458#M58742</guid>
      <dc:creator>0range</dc:creator>
      <dc:date>2015-09-02T07:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for part of a string matching a certain regex for an ID in a text field and replace it with "id"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-part-of-a-string-matching-a-certain-regex-for/m-p/202459#M58743</link>
      <description>&lt;P&gt;If the ID can be at any level, how is it distinguished from the rest of the file path?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2015 12:55:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-part-of-a-string-matching-a-certain-regex-for/m-p/202459#M58743</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-09-02T12:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for part of a string matching a certain regex for an ID in a text field and replace it with "id"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-part-of-a-string-matching-a-certain-regex-for/m-p/202460#M58744</link>
      <description>&lt;P&gt;It's numeric or alfa-numberic with special structure&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2015 17:44:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-part-of-a-string-matching-a-certain-regex-for/m-p/202460#M58744</guid>
      <dc:creator>0range</dc:creator>
      <dc:date>2015-10-07T17:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for part of a string matching a certain regex for an ID in a text field and replace it with "id"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-part-of-a-string-matching-a-certain-regex-for/m-p/202461#M58745</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| rex field=operation mode=sed "s/([0-9a-z]+\-)+[0-9a-z]+/id/" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Works fine:) thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2015 06:55:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-part-of-a-string-matching-a-certain-regex-for/m-p/202461#M58745</guid>
      <dc:creator>0range</dc:creator>
      <dc:date>2015-10-08T06:55:49Z</dc:date>
    </item>
  </channel>
</rss>

