<?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 How to remove characters in a field value?. in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-remove-characters-in-a-field-value/m-p/408523#M95910</link>
    <description>&lt;P&gt;I have below entries from my logs and I want to remove ' from the beginning and end of the field value.&lt;/P&gt;

&lt;P&gt;valid_from='May 25 13:46:01 2017 GMT ',valid_to='May 25 13:46:01 2019 GMT'&lt;/P&gt;

&lt;P&gt;Also how to get the difference in days for the &lt;STRONG&gt;valid_to-valid_from&lt;/STRONG&gt;?.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 22:10:13 GMT</pubDate>
    <dc:creator>pbsuju</dc:creator>
    <dc:date>2020-09-29T22:10:13Z</dc:date>
    <item>
      <title>How to remove characters in a field value?.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-remove-characters-in-a-field-value/m-p/408523#M95910</link>
      <description>&lt;P&gt;I have below entries from my logs and I want to remove ' from the beginning and end of the field value.&lt;/P&gt;

&lt;P&gt;valid_from='May 25 13:46:01 2017 GMT ',valid_to='May 25 13:46:01 2019 GMT'&lt;/P&gt;

&lt;P&gt;Also how to get the difference in days for the &lt;STRONG&gt;valid_to-valid_from&lt;/STRONG&gt;?.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:10:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-remove-characters-in-a-field-value/m-p/408523#M95910</guid>
      <dc:creator>pbsuju</dc:creator>
      <dc:date>2020-09-29T22:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove characters in a field value?.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-remove-characters-in-a-field-value/m-p/408524#M95911</link>
      <description>&lt;P&gt;Howdy pbsuju!&lt;/P&gt;

&lt;P&gt;strptime to transfrom to epoch and using an eval to pick the diff may be what you want. This is the paste of my test:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|  makeresults
| eval test="valid_from='May 25 13:46:01 2017 GMT ',valid_to='May 25 13:46:01 2019 GMT'"
| rex field=test "valid_from=\'(?&amp;lt;from&amp;gt;[^\']+)\',valid_to=\'(?&amp;lt;to&amp;gt;[^\']+)"
| eval to2=strptime(to,"%b %d %H:%M:%S %Y %Z")
| eval from2=strptime(from,"%b %d %H:%M:%S %Y %Z")
| eval diff=(from2-to2)
| table test,from,from2,to,to2,diff
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Nov 2018 10:14:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-remove-characters-in-a-field-value/m-p/408524#M95911</guid>
      <dc:creator>osakachan</dc:creator>
      <dc:date>2018-11-21T10:14:14Z</dc:date>
    </item>
  </channel>
</rss>

