<?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 Why is values(foo) here? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-values-foo-here/m-p/266844#M80255</link>
    <description>&lt;P&gt;Why is values(Authentication.user_category) here when further down there is "where Authentication.user_category=default"? The where statement would only show results when Authentication.user_category=default, but isn't values(Authentication.user_category) giving a list of  all the distinct values of the field "user_category"? So wouldn't there only be one distinct value shown, "default", because that's how the search is filtering it?&lt;/P&gt;

&lt;P&gt;| tstats &lt;CODE&gt;summariesonly&lt;/CODE&gt; max(_time) as _time,values(Authentication.user_category) as user_category,dc(Authentication.dest) as dc(dest) from datamodel=Authentication where Authentication.user_category=default by Authentication.user | &lt;CODE&gt;drop_dm_object_name("Authentication")&lt;/CODE&gt; | sort 100 - _time | fields _time,user,user_category,dc(dest)&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 11:30:49 GMT</pubDate>
    <dc:creator>Justin1224</dc:creator>
    <dc:date>2020-09-29T11:30:49Z</dc:date>
    <item>
      <title>Why is values(foo) here?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-values-foo-here/m-p/266844#M80255</link>
      <description>&lt;P&gt;Why is values(Authentication.user_category) here when further down there is "where Authentication.user_category=default"? The where statement would only show results when Authentication.user_category=default, but isn't values(Authentication.user_category) giving a list of  all the distinct values of the field "user_category"? So wouldn't there only be one distinct value shown, "default", because that's how the search is filtering it?&lt;/P&gt;

&lt;P&gt;| tstats &lt;CODE&gt;summariesonly&lt;/CODE&gt; max(_time) as _time,values(Authentication.user_category) as user_category,dc(Authentication.dest) as dc(dest) from datamodel=Authentication where Authentication.user_category=default by Authentication.user | &lt;CODE&gt;drop_dm_object_name("Authentication")&lt;/CODE&gt; | sort 100 - _time | fields _time,user,user_category,dc(dest)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:30:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-values-foo-here/m-p/266844#M80255</guid>
      <dc:creator>Justin1224</dc:creator>
      <dc:date>2020-09-29T11:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Why is values(foo) here?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-values-foo-here/m-p/266845#M80256</link>
      <description>&lt;P&gt;That is correct. The creator of the search may wanted to print the value of Authentication.user_category in the result hence he may've added it. It could be replaced by search like this (use an eval to create a static field).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats summariesonly max(_time) as _time,dc(Authentication.dest) as dc(dest) from datamodel=Authentication where Authentication.user_category=default by Authentication.user | drop_dm_object_name("Authentication") | eval user_category="default" | sort 100 - _time | fields _time,user,user_category,dc(dest)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Oct 2016 14:24:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-values-foo-here/m-p/266845#M80256</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-10-20T14:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Why is values(foo) here?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-values-foo-here/m-p/266846#M80257</link>
      <description>&lt;P&gt;You are correct, you will only ever see the &lt;CODE&gt;user_category&lt;/CODE&gt; with a value of &lt;CODE&gt;default&lt;/CODE&gt; in the corresponding results. You would get the same result by removing that operator and adding &lt;CODE&gt;Authentication.user_category&lt;/CODE&gt; to the &lt;CODE&gt;by&lt;/CODE&gt; clause. &lt;/P&gt;

&lt;P&gt;It just carries the filtered value into the results. There are other ways you could do this, this is just one way.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2016 14:26:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-values-foo-here/m-p/266846#M80257</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2016-10-20T14:26:00Z</dc:date>
    </item>
  </channel>
</rss>

