<?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: Replacing values outputted from |stats with values from another search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-values-outputted-from-stats-with-values-from/m-p/590544#M205603</link>
    <description>&lt;P&gt;Thank you, this inline search got me to where I needed to be.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Mar 2022 22:53:13 GMT</pubDate>
    <dc:creator>DenverGeo</dc:creator>
    <dc:date>2022-03-23T22:53:13Z</dc:date>
    <item>
      <title>How to replace values outputted from |stats with values from another search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-values-outputted-from-stats-with-values-from/m-p/589898#M205384</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;I am attempting to take a variety of values for a single field and essentially use another search from a different index to rename them to a more human readable value. Both indexes do have a field that contains a 1:1 value that I could potentially use |join, however I am having issues with the stats table output where the search is failing to pull up any data or pulling up all data despite searching for a specific value in a field. I have tried |append as well but not getting the results I expect.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=index_ mac_address=* logical_vm=* state=online
| stats latest(physical_vm) as server latest(ip_address) as IP latest(logical_vm) as host by mac_address 
| search server=z4c8h2 IP=* host=* name=*
| stats count by server

Output:
mac_address | server | IP | host
xx:xx:xx:xx:xx:xx | z4c8h2 | 10.0.0.0 | vm01.internet.io

index=translate box=z4c8h2
| table human_name&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The translate index search shows the name that I would like to replace in the index_ search for server, but cant get the stats table to update correctly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestions how to format a join/append or some other method of getting the value to update in the Stats output table?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 22:58:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-values-outputted-from-stats-with-values-from/m-p/589898#M205384</guid>
      <dc:creator>DenverGeo</dc:creator>
      <dc:date>2022-03-23T22:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing values outputted from |stats with values from another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-values-outputted-from-stats-with-values-from/m-p/589906#M205387</link>
      <description>&lt;P&gt;Sounds like you could use a lookup.&lt;/P&gt;&lt;P&gt;You index that contains the human_name - is that something that could be turned into a lookup, where the values are static - if so, then after your stats you would simply do&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
| lookup server_list.csv server &lt;/LI-CODE&gt;&lt;P&gt;where the lookup file contains the server/human_name.&lt;/P&gt;&lt;P&gt;From your naming of the index, it would appear that this data is designed to be a way to translate box--&amp;gt;human_name - is that right? If so, then lookup would seem an option.&lt;/P&gt;&lt;P&gt;If a lookup is not practical, then you need another solution - note that join is an option - but you always explore alternatives before using join, as it has limitations.&lt;/P&gt;&lt;P&gt;The join option sounds simple enough&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| join server [
  index=translate
  | rename box as server
  | fields server human_name
]&lt;/LI-CODE&gt;&lt;P&gt;A stats solution would need to correlation the human_name/box/server/mac_address fields to get it done in a single search.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 01:14:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-values-outputted-from-stats-with-values-from/m-p/589906#M205387</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-03-21T01:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing values outputted from |stats with values from another search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-replace-values-outputted-from-stats-with-values-from/m-p/590544#M205603</link>
      <description>&lt;P&gt;Thank you, this inline search got me to where I needed to be.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 22:53:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-replace-values-outputted-from-stats-with-values-from/m-p/590544#M205603</guid>
      <dc:creator>DenverGeo</dc:creator>
      <dc:date>2022-03-23T22:53:13Z</dc:date>
    </item>
  </channel>
</rss>

