<?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 do I get a substring from a field after the &amp;quot;_&amp;quot; character? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-substring-from-a-field-after-the-quot-quot/m-p/403653#M116794</link>
    <description>&lt;P&gt;You can use rex to get the date substring and then use strptime and strftime to date format. Suppose your string is x="ABCD_20190219_XYZ", then use the below command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=x "_(?&amp;lt;date&amp;gt;\S{8})"| eval time=strptime(date,"%Y%m%d")|eval Date=strftime(time,"%m/%d/%Y")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 29 Sep 2020 23:23:58 GMT</pubDate>
    <dc:creator>Vijeta</dc:creator>
    <dc:date>2020-09-29T23:23:58Z</dc:date>
    <item>
      <title>How do I get a substring from a field after the "_" character?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-substring-from-a-field-after-the-quot-quot/m-p/403652#M116793</link>
      <description>&lt;P&gt;I have a string as ABCD_20190219_XYZ&lt;/P&gt;

&lt;P&gt;I need to get 20190219 like 8 characters after first "_" and than convert that substring to a date.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:23:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-substring-from-a-field-after-the-quot-quot/m-p/403652#M116793</guid>
      <dc:creator>vb1612</dc:creator>
      <dc:date>2020-09-29T23:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a substring from a field after the "_" character?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-substring-from-a-field-after-the-quot-quot/m-p/403653#M116794</link>
      <description>&lt;P&gt;You can use rex to get the date substring and then use strptime and strftime to date format. Suppose your string is x="ABCD_20190219_XYZ", then use the below command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=x "_(?&amp;lt;date&amp;gt;\S{8})"| eval time=strptime(date,"%Y%m%d")|eval Date=strftime(time,"%m/%d/%Y")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:23:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-a-substring-from-a-field-after-the-quot-quot/m-p/403653#M116794</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2020-09-29T23:23:58Z</dc:date>
    </item>
  </channel>
</rss>

