<?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 replace Unique Values? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-Unique-Values/m-p/605168#M210457</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have several events in the _raw field that add a unique identification number. I would like to replace these with something standard to aggregate counts on.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example Data:&lt;/P&gt;
&lt;P&gt;fi/transaction/card/purchase/tx_2994882028948/refund&lt;/P&gt;
&lt;P&gt;fi/transaction/card/purchase/tx_3920496893002/void&lt;/P&gt;
&lt;P&gt;fi/transaction/card/purchase/tx_2930540482198/refund&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd like these all to read:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;fi/transaction/card/purchase/trans/refund&lt;/P&gt;
&lt;P&gt;fi/transaction/card/purchase/trans/void&lt;/P&gt;
&lt;P&gt;fi/transaction/card/purchase/trans/refund&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So replace the unique identifier, but maintain the verbiage at the end.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've tried a few of the other methods noted in other threads, but to no avail. Some don't work at all, some run, but don't replace the values.&lt;/P&gt;
&lt;P&gt;Thanks!!&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jul 2022 16:41:56 GMT</pubDate>
    <dc:creator>mcscjlf</dc:creator>
    <dc:date>2022-07-11T16:41:56Z</dc:date>
    <item>
      <title>How to replace Unique Values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-Unique-Values/m-p/605168#M210457</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have several events in the _raw field that add a unique identification number. I would like to replace these with something standard to aggregate counts on.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example Data:&lt;/P&gt;
&lt;P&gt;fi/transaction/card/purchase/tx_2994882028948/refund&lt;/P&gt;
&lt;P&gt;fi/transaction/card/purchase/tx_3920496893002/void&lt;/P&gt;
&lt;P&gt;fi/transaction/card/purchase/tx_2930540482198/refund&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd like these all to read:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;fi/transaction/card/purchase/trans/refund&lt;/P&gt;
&lt;P&gt;fi/transaction/card/purchase/trans/void&lt;/P&gt;
&lt;P&gt;fi/transaction/card/purchase/trans/refund&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So replace the unique identifier, but maintain the verbiage at the end.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've tried a few of the other methods noted in other threads, but to no avail. Some don't work at all, some run, but don't replace the values.&lt;/P&gt;
&lt;P&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 16:41:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-Unique-Values/m-p/605168#M210457</guid>
      <dc:creator>mcscjlf</dc:creator>
      <dc:date>2022-07-11T16:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Unique Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-Unique-Values/m-p/605173#M210459</link>
      <description>&lt;P&gt;If your unique identification number match a common pattern, then you can you rex in sed mode&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex mode=sed "s/\/tx_\d+\/\/trans\//g"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 15:48:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-Unique-Values/m-p/605173#M210459</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-07-11T15:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Unique Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-Unique-Values/m-p/605174#M210460</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247555"&gt;@mcscjlf&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;You could try something like that (assuming that you want to see this data in search-time):&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex mode=sed field=_raw "s/(\S+)(tx_\S+)(\/\S+)/\1trans\3/g"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can change the&amp;nbsp;&lt;STRONG&gt;field=_raw&amp;nbsp;&lt;/STRONG&gt;to your specific field, if it is being extracted already in a field.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 15:49:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-Unique-Values/m-p/605174#M210460</guid>
      <dc:creator>danielcj</dc:creator>
      <dc:date>2022-07-11T15:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace Unique Values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-Unique-Values/m-p/605314#M210490</link>
      <description>&lt;P&gt;Thanks for the suggestions! Unfortunately, neither worked. I am trying to change this data in the search and only for the search results, I don't want to permanently change the underlying data. Perhaps my other search criteria is affecting the results with the solutions provided.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Search Criteria:&lt;/P&gt;&lt;P&gt;host="Example"&amp;nbsp; sourcetype=Hexflag2&amp;nbsp; /fi/transaction/* | rex "POST (?&amp;lt;transact&amp;gt;/S+)" | stats county by transact&lt;/P&gt;&lt;P&gt;This returns the example data below, I'm just hoping for a way to condense all of the unique values to something I can rollup into a usage count.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 16:35:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-Unique-Values/m-p/605314#M210490</guid>
      <dc:creator>mcscjlf</dc:creator>
      <dc:date>2022-07-12T16:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace Unique Values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-Unique-Values/m-p/605317#M210491</link>
      <description>&lt;P&gt;Firstly, rex mode=sed doesn't change the underlying data permanently, it just modifies the events in the event pipeline.&lt;/P&gt;&lt;P&gt;It looks like I missed a slash out - try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;host="Example"  sourcetype=Hexflag2  /fi/transaction/*
| rex mode=sed "s/\/tx_\d+\//\/trans\//g"
| rex "POST (?&amp;lt;transact&amp;gt;/\S+)" 
| stats count by transact&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 12 Jul 2022 17:07:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-Unique-Values/m-p/605317#M210491</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-07-12T17:07:17Z</dc:date>
    </item>
  </channel>
</rss>

