<?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: Replace values in query in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Replace-values-in-query/m-p/538627#M4874</link>
    <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/216287"&gt;@leandromatperei&lt;/a&gt;,&lt;BR /&gt;You can use &lt;STRONG&gt;eval&lt;/STRONG&gt; command with &lt;STRONG&gt;case&lt;/STRONG&gt; function.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval host=case(host="host1", "Valuea", host="host1", "Valueb", host="host1","Valuec", host="host1", "Valued") &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this reply helps you, an upvote/like would be appreciated.&lt;/P&gt;</description>
    <pubDate>Thu, 04 Feb 2021 14:50:50 GMT</pubDate>
    <dc:creator>manjunathmeti</dc:creator>
    <dc:date>2021-02-04T14:50:50Z</dc:date>
    <item>
      <title>Replace values in query</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Replace-values-in-query/m-p/538619#M4873</link>
      <description>&lt;P&gt;Guys.&lt;/P&gt;&lt;P&gt;I have the following query below that shows the results by hosts, it works very well. However, I need to replace the host with another value, example below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=text (host=host1 OR host=host2 OR host=host3 OR host=host4)) 
 timechart span=1h count by host&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;host1 = Valuea
host2 = Valueb
host3 = Valuec
host4= Valued&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the best way to make this replacement using eval or a lookup?&lt;/P&gt;&lt;P&gt;Att.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 14:16:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Replace-values-in-query/m-p/538619#M4873</guid>
      <dc:creator>leandromatperei</dc:creator>
      <dc:date>2021-02-04T14:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Replace values in query</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Replace-values-in-query/m-p/538627#M4874</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/216287"&gt;@leandromatperei&lt;/a&gt;,&lt;BR /&gt;You can use &lt;STRONG&gt;eval&lt;/STRONG&gt; command with &lt;STRONG&gt;case&lt;/STRONG&gt; function.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval host=case(host="host1", "Valuea", host="host1", "Valueb", host="host1","Valuec", host="host1", "Valued") &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this reply helps you, an upvote/like would be appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 14:50:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Replace-values-in-query/m-p/538627#M4874</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2021-02-04T14:50:50Z</dc:date>
    </item>
  </channel>
</rss>

