<?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 list multiple fields separately and calculate stats? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-multiple-fields-separately-and-calculate-stats/m-p/392448#M114183</link>
    <description>&lt;P&gt;hello, the truth is the query is that but I do not know how to perform the missing part to group the values or make a state dedup and list them&lt;/P&gt;</description>
    <pubDate>Fri, 03 Aug 2018 18:56:56 GMT</pubDate>
    <dc:creator>efaundez</dc:creator>
    <dc:date>2018-08-03T18:56:56Z</dc:date>
    <item>
      <title>How to list multiple fields separately and calculate stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-multiple-fields-separately-and-calculate-stats/m-p/392445#M114180</link>
      <description>&lt;P&gt;good afternoon&lt;/P&gt;

&lt;P&gt;It is possible to group in a variable the state of multiple fields? Currently I have several fields and each one has to fulfill a condition, but if this happens the state NOK must remain&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index = "test" sourcetype = "test2"
| stats
max (field1) as field1,
max (field2) as field2
by _time
| eval var1 = if (field1 &amp;lt;9999, "NOK", var1)
| eval var2 = if (field2 &amp;lt;9999, "NOK", var2)
| fields - _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this example the values are shown to me this way and many times the NOK value, which only needs 1&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5511i31DD109E790ACCFE/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Does anybody have any suggestions?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 17:47:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-multiple-fields-separately-and-calculate-stats/m-p/392445#M114180</guid>
      <dc:creator>efaundez</dc:creator>
      <dc:date>2018-08-03T17:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to list multiple fields separately and calculate stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-multiple-fields-separately-and-calculate-stats/m-p/392446#M114181</link>
      <description>&lt;P&gt;Is there some portion of query missing? You're referencing field var1 and var2 in your eval expressions (on RHS of &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt; but they don't exist after your stats command. &lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 18:04:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-multiple-fields-separately-and-calculate-stats/m-p/392446#M114181</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-08-03T18:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to list multiple fields separately and calculate stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-multiple-fields-separately-and-calculate-stats/m-p/392447#M114182</link>
      <description>&lt;P&gt;if I am understanding the question right. I believe what you want to look up is the &lt;CODE&gt;transpose&lt;/CODE&gt; function it turns columns into rows&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.1.2/SearchReference/Transpose"&gt;https://docs.splunk.com/Documentation/Splunk/7.1.2/SearchReference/Transpose&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 18:18:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-multiple-fields-separately-and-calculate-stats/m-p/392447#M114182</guid>
      <dc:creator>kiamco</dc:creator>
      <dc:date>2018-08-03T18:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to list multiple fields separately and calculate stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-multiple-fields-separately-and-calculate-stats/m-p/392448#M114183</link>
      <description>&lt;P&gt;hello, the truth is the query is that but I do not know how to perform the missing part to group the values or make a state dedup and list them&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 18:56:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-multiple-fields-separately-and-calculate-stats/m-p/392448#M114183</guid>
      <dc:creator>efaundez</dc:creator>
      <dc:date>2018-08-03T18:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to list multiple fields separately and calculate stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-multiple-fields-separately-and-calculate-stats/m-p/392449#M114184</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;H4&gt;Final Answer&lt;/H4&gt;

&lt;PRE&gt;&lt;CODE&gt;..base search
| stats
max (field1) as field1,
max (field2) as field2
by _time
| eval var1 = if (field1 &amp;lt;9999, "NOK", var1)
| eval var2 = if (field2 &amp;lt;9999, "NOK", var2)
| dedup var1 var2
| eval temp=0 | untable temp "N*Var" "NOK Status"
| where 'NOK Status' = "NOK"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Aug 2018 19:13:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-multiple-fields-separately-and-calculate-stats/m-p/392449#M114184</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-08-03T19:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to list multiple fields separately and calculate stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-multiple-fields-separately-and-calculate-stats/m-p/392450#M114185</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;Thank you very much is almost 99% of what I wanted, can you do something similar to this?&lt;/P&gt;

&lt;P&gt;| where "NOK Status"! = "OK"&lt;/P&gt;

&lt;P&gt;It would only filter the NOK states&lt;/P&gt;

&lt;P&gt;Agradesco your answer.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 19:34:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-multiple-fields-separately-and-calculate-stats/m-p/392450#M114185</guid>
      <dc:creator>efaundez</dc:creator>
      <dc:date>2018-08-03T19:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to list multiple fields separately and calculate stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-multiple-fields-separately-and-calculate-stats/m-p/392451#M114186</link>
      <description>&lt;P&gt;Yes.. just add &lt;CODE&gt;| where 'NOK Status'="NOK"&lt;/CODE&gt; to end of above search.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 19:41:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-multiple-fields-separately-and-calculate-stats/m-p/392451#M114186</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-08-03T19:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to list multiple fields separately and calculate stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-multiple-fields-separately-and-calculate-stats/m-p/392452#M114187</link>
      <description>&lt;P&gt;gracias por todo&lt;/P&gt;

&lt;P&gt;Saludos&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 19:54:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-multiple-fields-separately-and-calculate-stats/m-p/392452#M114187</guid>
      <dc:creator>efaundez</dc:creator>
      <dc:date>2018-08-03T19:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to list multiple fields separately and calculate stats?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-multiple-fields-separately-and-calculate-stats/m-p/392453#M114188</link>
      <description>&lt;P&gt;Glad to be of help. If there are no further follow-up question related to this, do remember to accept this answer to close the question.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 20:22:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-multiple-fields-separately-and-calculate-stats/m-p/392453#M114188</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-08-03T20:22:43Z</dc:date>
    </item>
  </channel>
</rss>

