<?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: Replace A pattern Splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Replace-A-pattern-Splunk/m-p/196952#M56864</link>
    <description>&lt;P&gt;about using eval?&lt;/P&gt;

&lt;P&gt;･･･|eval Month=if(len(Month)==6,"0"+Month,Month)&lt;/P&gt;</description>
    <pubDate>Thu, 12 Jun 2014 09:40:58 GMT</pubDate>
    <dc:creator>HiroshiSatoh</dc:creator>
    <dc:date>2014-06-12T09:40:58Z</dc:date>
    <item>
      <title>Replace A pattern Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-A-pattern-Splunk/m-p/196951#M56863</link>
      <description>&lt;P&gt;Hello Guys ,&lt;/P&gt;

&lt;P&gt;I have a field Month that have values like this&lt;/P&gt;

&lt;P&gt;1-2013&lt;BR /&gt;
10-2014&lt;BR /&gt;
9-2014&lt;/P&gt;

&lt;P&gt;i would like to get 0X-YYYY if month &amp;lt;10&lt;/P&gt;

&lt;P&gt;so 1-2013 becomes 01-2013&lt;BR /&gt;
10-2014 stays 10-2014&lt;BR /&gt;
9-2014 becomes 09-2014&lt;/P&gt;

&lt;P&gt;I've tried  rex mode=sed field="Month" "s/(^[0-9]-.*)/0\1/"  (it works fine on linux but not on Splunk ..)&lt;/P&gt;

&lt;P&gt;Could you help me ?&lt;/P&gt;

&lt;P&gt;Thanks !&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jun 2014 08:59:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-A-pattern-Splunk/m-p/196951#M56863</guid>
      <dc:creator>baranova</dc:creator>
      <dc:date>2014-06-12T08:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Replace A pattern Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-A-pattern-Splunk/m-p/196952#M56864</link>
      <description>&lt;P&gt;about using eval?&lt;/P&gt;

&lt;P&gt;･･･|eval Month=if(len(Month)==6,"0"+Month,Month)&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jun 2014 09:40:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-A-pattern-Splunk/m-p/196952#M56864</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2014-06-12T09:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: Replace A pattern Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-A-pattern-Splunk/m-p/196953#M56865</link>
      <description>&lt;P&gt;I'm not familiar with sed mode, but have you tried escaping the square brackets with a backslash. Whenever a regex fails to match the expected results my first thought is always escaping special characters. Some regex modes assume special meaning unless expressly suppressed whilst others are the reverse, and just for fun some assume special meaning for one subset whilst not for others. It can be mind-bendingly confusing.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jun 2014 09:41:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-A-pattern-Splunk/m-p/196953#M56865</guid>
      <dc:creator>grijhwani</dc:creator>
      <dc:date>2014-06-12T09:41:07Z</dc:date>
    </item>
  </channel>
</rss>

