<?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 to reverse field value in Splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-reverse-field-value-in-Splunk/m-p/649630#M224616</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/228118"&gt;@joomla&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if the structure is fixed, you can use a regex, otherwise I suppose that it isn't possible:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| rex field=domain "^(?&amp;lt;part1&amp;gt;[^\.]+)\.^(?&amp;lt;part2&amp;gt;[^\.]+)\.^(?&amp;lt;part3&amp;gt;[^\.]+)"
| eval new_domain=part3.".".part2.".".part1
| table domain new_domain&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jul 2023 12:58:51 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2023-07-07T12:58:51Z</dc:date>
    <item>
      <title>how to reverse field value in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-reverse-field-value-in-Splunk/m-p/649624#M224614</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a field name domain with value "&lt;A href="http://www.microsoft.com" target="_blank" rel="noopener"&gt;www.microsoft.com&lt;/A&gt;"; how I can reverse that and make it to "com.microsoft.www"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;domain=&lt;A href="http://www.microsoft.com" target="_blank" rel="noopener"&gt;www.microsoft.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;required: domain=com.microsoft.www&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 11:28:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-reverse-field-value-in-Splunk/m-p/649624#M224614</guid>
      <dc:creator>joomla</dc:creator>
      <dc:date>2023-07-07T11:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to reverse field value in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-reverse-field-value-in-Splunk/m-p/649629#M224615</link>
      <description>&lt;LI-CODE lang="markup"&gt;| eval _domain=split(domain,".")
| foreach mode=multivalue _domain
    [| eval dom=if(isnull(dom),&amp;lt;&amp;lt;ITEM&amp;gt;&amp;gt;,&amp;lt;&amp;lt;ITEM&amp;gt;&amp;gt;.".".dom)]&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 07 Jul 2023 12:49:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-reverse-field-value-in-Splunk/m-p/649629#M224615</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-07-07T12:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to reverse field value in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-reverse-field-value-in-Splunk/m-p/649630#M224616</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/228118"&gt;@joomla&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if the structure is fixed, you can use a regex, otherwise I suppose that it isn't possible:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| rex field=domain "^(?&amp;lt;part1&amp;gt;[^\.]+)\.^(?&amp;lt;part2&amp;gt;[^\.]+)\.^(?&amp;lt;part3&amp;gt;[^\.]+)"
| eval new_domain=part3.".".part2.".".part1
| table domain new_domain&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2023 12:58:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-reverse-field-value-in-Splunk/m-p/649630#M224616</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-07-07T12:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to reverse field value in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-reverse-field-value-in-Splunk/m-p/649631#M224617</link>
      <description>&lt;P&gt;This is a new one to me.&amp;nbsp; If the domain is always 3 parts you can split the domain then use foreach to put the pieces back together in reverse order as in this run-anywhere example.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval domain="www.microsoft.com" 
``` Above just creates demo data ```
``` Break the domain at each dot ```
| eval foo=split(domain,".") 
``` Iterate over the segments in reverse order and put them together ```
| foreach 2 1 0 [ eval rev_domain=mvjoin(mvappend(rev_domain,mvindex(foo,&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;)),".")] 
| table domain rev_domain&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 07 Jul 2023 13:02:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-reverse-field-value-in-Splunk/m-p/649631#M224617</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-07-07T13:02:44Z</dc:date>
    </item>
  </channel>
</rss>

