<?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 group multiple field values into one field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-multiple-field-values-into-one-field/m-p/456382#M129019</link>
    <description>&lt;P&gt;That would be the way to go. A minor cosmetic change (clubbing multiple conditions together, adding else/default forrest of values/conditions):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo (my_field=1 OR my_field=2 OR my_field=3 OR my_field=4 OR my_field=5 OR my_field=6)
 | eval status=case(my_field=1 OR my_field=2 OR  my_field=3, "start", true(), "end")
 | stats count by status
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 26 Mar 2019 13:44:25 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2019-03-26T13:44:25Z</dc:date>
    <item>
      <title>How to group multiple field values into one field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-multiple-field-values-into-one-field/m-p/456380#M129017</link>
      <description>&lt;P&gt;I have logs where I want to count multiple values for a single field as "start" and other various values as "end".  How would I go about this?  I want to be able to show two rows or columns where I show the total number of start and end values.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo (my_field=1 OR my_field=2 OR my_field=3 OR my_field=4 OR my_field=5 OR my_field=6)
| eval start = my_field=1 OR my_field=2 OR my_field=3
| eval end = my_field=4 OR my_field=5 OR my_field=6
| stats count by start end
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Mar 2019 13:21:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-multiple-field-values-into-one-field/m-p/456380#M129017</guid>
      <dc:creator>DEAD_BEEF</dc:creator>
      <dc:date>2019-03-26T13:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to group multiple field values into one field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-multiple-field-values-into-one-field/m-p/456381#M129018</link>
      <description>&lt;P&gt;I ended up using case&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo (my_field=1 OR my_field=2 OR my_field=3 OR my_field=4 OR my_field=5 OR my_field=6)
| eval status=case(my_field=1 "start", my_field=2 "start", my_field=3 "start", my_field=4 "end", my_field=5 "end", my_field=6 "end")
| stats count by status
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Mar 2019 13:36:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-multiple-field-values-into-one-field/m-p/456381#M129018</guid>
      <dc:creator>DEAD_BEEF</dc:creator>
      <dc:date>2019-03-26T13:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to group multiple field values into one field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-multiple-field-values-into-one-field/m-p/456382#M129019</link>
      <description>&lt;P&gt;That would be the way to go. A minor cosmetic change (clubbing multiple conditions together, adding else/default forrest of values/conditions):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo (my_field=1 OR my_field=2 OR my_field=3 OR my_field=4 OR my_field=5 OR my_field=6)
 | eval status=case(my_field=1 OR my_field=2 OR  my_field=3, "start", true(), "end")
 | stats count by status
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Mar 2019 13:44:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-multiple-field-values-into-one-field/m-p/456382#M129019</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-03-26T13:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to group multiple field values into one field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-group-multiple-field-values-into-one-field/m-p/456383#M129020</link>
      <description>&lt;P&gt;You could use "in" function to check the static value list to the above query:&lt;/P&gt;

&lt;P&gt;index=foo (my_field=1 OR my_field=2 OR my_field=3 OR my_field=4 OR my_field=5 OR my_field=6)&lt;BR /&gt;
| eval status=case(in(my_field,1,2,3),"Start",in(my_field,4,5,6),"End",1==1,NULL)&lt;BR /&gt;
| stats count by status&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:49:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-group-multiple-field-values-into-one-field/m-p/456383#M129020</guid>
      <dc:creator>khreddy</dc:creator>
      <dc:date>2020-09-29T23:49:17Z</dc:date>
    </item>
  </channel>
</rss>

