<?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 Remove timestamps using regex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Remove-timestamps-using-regex/m-p/575164#M200418</link>
    <description>&lt;P&gt;Hi Splunk Community,&lt;/P&gt;&lt;P&gt;It's been a while since I've last used Splunk and regex, and now I'm struggling with both &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Fields that I need to use ("resourceId") contain two user IDs and timestamps (e.g., "owner-10785-user-3801-key-1637099215"). I'm looking to keep the IDs and remove timestamps (basically everything after "owner-19803-user-8925-").&lt;/P&gt;&lt;P&gt;I came up with this clumsy thing:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;index=main | eval resourceId1=replace (resourceId, "user-(?&amp;lt;user_id&amp;gt;\d+)", "") | eval resourceId2=replace (resourceId1, "owner-(?&amp;lt;owner_id&amp;gt;\d+)", "") | table resourceId2&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;It kind of works, the only problem is that it gives me the opposite result - it removes all the IDs leaving the timestamps, like this:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;resourceId2&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;--key-1637100297&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;--1637100120.0929909&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;--key-1637100118&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;But I need the opposite. Can anyone please help?&lt;/P&gt;</description>
    <pubDate>Tue, 16 Nov 2021 22:30:49 GMT</pubDate>
    <dc:creator>oliverpeloton23</dc:creator>
    <dc:date>2021-11-16T22:30:49Z</dc:date>
    <item>
      <title>Remove timestamps using regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-timestamps-using-regex/m-p/575164#M200418</link>
      <description>&lt;P&gt;Hi Splunk Community,&lt;/P&gt;&lt;P&gt;It's been a while since I've last used Splunk and regex, and now I'm struggling with both &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Fields that I need to use ("resourceId") contain two user IDs and timestamps (e.g., "owner-10785-user-3801-key-1637099215"). I'm looking to keep the IDs and remove timestamps (basically everything after "owner-19803-user-8925-").&lt;/P&gt;&lt;P&gt;I came up with this clumsy thing:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;index=main | eval resourceId1=replace (resourceId, "user-(?&amp;lt;user_id&amp;gt;\d+)", "") | eval resourceId2=replace (resourceId1, "owner-(?&amp;lt;owner_id&amp;gt;\d+)", "") | table resourceId2&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;It kind of works, the only problem is that it gives me the opposite result - it removes all the IDs leaving the timestamps, like this:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;resourceId2&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;--key-1637100297&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;--1637100120.0929909&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;--key-1637100118&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;But I need the opposite. Can anyone please help?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 22:30:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-timestamps-using-regex/m-p/575164#M200418</guid>
      <dc:creator>oliverpeloton23</dc:creator>
      <dc:date>2021-11-16T22:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Remove timestamps using regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-timestamps-using-regex/m-p/575165#M200419</link>
      <description>&lt;LI-CODE lang="markup"&gt;| rex field=resourceId "owner-(?&amp;lt;owner&amp;gt;\d+)-user-(?&amp;lt;user&amp;gt;\d+)"
| eval resourceId2="owner-".owner."-user-".user&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 16 Nov 2021 22:40:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-timestamps-using-regex/m-p/575165#M200419</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-11-16T22:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Remove timestamps using regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Remove-timestamps-using-regex/m-p/575167#M200420</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 22:48:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Remove-timestamps-using-regex/m-p/575167#M200420</guid>
      <dc:creator>oliverpeloton23</dc:creator>
      <dc:date>2021-11-16T22:48:47Z</dc:date>
    </item>
  </channel>
</rss>

