<?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 Include AND/OR operator in Pivot query in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/Include-AND-OR-operator-in-Pivot-query/m-p/395446#M6704</link>
    <description>&lt;P&gt;Hi guys,&lt;BR /&gt;
my problem is how to make working following query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| pivot Cisco_IOS_Event Cisco_IOS_Event count(host) AS "Count of host" avg(severity_id) AS "Average of severity_id" count(Cisco_IOS_Event) AS "Count of Cisco IOS Event" SPLITROW host AS host SORT 100 host ROWSUMMARY 0 COLSUMMARY 0 NUMCOLS 0 SHOWOTHER 1 FILTER host is $host$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;where &lt;STRONG&gt;$host$&lt;/STRONG&gt; refers to a field of a checkbox as&lt;/P&gt;

&lt;H2&gt;&lt;STRONG&gt;(host=10.29.28.&lt;EM&gt;) OR (host=10.29.72.&lt;/EM&gt;)&lt;/STRONG&gt;&lt;/H2&gt;

&lt;P&gt;i've no problem if network is only one, but AND or OR operator  are making my head spinning 'cause not admitted if prefixed to PIVOT query.. &lt;STRONG&gt;"The pivot command can only be used as the first command on a search"&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;any idea abt how solve this?&lt;/P&gt;

&lt;P&gt;many thx&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jun 2018 23:03:17 GMT</pubDate>
    <dc:creator>null0</dc:creator>
    <dc:date>2018-06-18T23:03:17Z</dc:date>
    <item>
      <title>Include AND/OR operator in Pivot query</title>
      <link>https://community.splunk.com/t5/Reporting/Include-AND-OR-operator-in-Pivot-query/m-p/395446#M6704</link>
      <description>&lt;P&gt;Hi guys,&lt;BR /&gt;
my problem is how to make working following query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| pivot Cisco_IOS_Event Cisco_IOS_Event count(host) AS "Count of host" avg(severity_id) AS "Average of severity_id" count(Cisco_IOS_Event) AS "Count of Cisco IOS Event" SPLITROW host AS host SORT 100 host ROWSUMMARY 0 COLSUMMARY 0 NUMCOLS 0 SHOWOTHER 1 FILTER host is $host$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;where &lt;STRONG&gt;$host$&lt;/STRONG&gt; refers to a field of a checkbox as&lt;/P&gt;

&lt;H2&gt;&lt;STRONG&gt;(host=10.29.28.&lt;EM&gt;) OR (host=10.29.72.&lt;/EM&gt;)&lt;/STRONG&gt;&lt;/H2&gt;

&lt;P&gt;i've no problem if network is only one, but AND or OR operator  are making my head spinning 'cause not admitted if prefixed to PIVOT query.. &lt;STRONG&gt;"The pivot command can only be used as the first command on a search"&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;any idea abt how solve this?&lt;/P&gt;

&lt;P&gt;many thx&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 23:03:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Include-AND-OR-operator-in-Pivot-query/m-p/395446#M6704</guid>
      <dc:creator>null0</dc:creator>
      <dc:date>2018-06-18T23:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: Include AND/OR operator in Pivot query</title>
      <link>https://community.splunk.com/t5/Reporting/Include-AND-OR-operator-in-Pivot-query/m-p/395447#M6705</link>
      <description>&lt;P&gt;guys! no idea how to solve this?&lt;/P&gt;

&lt;P&gt;Please &lt;/P&gt;</description>
      <pubDate>Mon, 25 Jun 2018 09:41:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Include-AND-OR-operator-in-Pivot-query/m-p/395447#M6705</guid>
      <dc:creator>null0</dc:creator>
      <dc:date>2018-06-25T09:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Include AND/OR operator in Pivot query</title>
      <link>https://community.splunk.com/t5/Reporting/Include-AND-OR-operator-in-Pivot-query/m-p/395448#M6706</link>
      <description>&lt;P&gt;Hi @null0,&lt;/P&gt;

&lt;P&gt;Try &lt;CODE&gt;in&lt;/CODE&gt; in your filter &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | pivot Cisco_IOS_Event Cisco_IOS_Event count(host) AS "Count of host" avg(severity_id) AS "Average of severity_id" count(Cisco_IOS_Event) AS "Count of Cisco IOS Event" SPLITROW host AS host SORT 100 host ROWSUMMARY 0 COLSUMMARY 0 NUMCOLS 0 SHOWOTHER 1 FILTER host in $host|s$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And set the token so that the values are in a format (value1,value2,value3,etc)&lt;/P&gt;

&lt;P&gt;Reference : &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.1/SearchReference/Pivot#Descriptions_for_filter_elements"&gt;http://docs.splunk.com/Documentation/Splunk/7.1.1/SearchReference/Pivot#Descriptions_for_filter_elements&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jun 2018 13:13:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Include-AND-OR-operator-in-Pivot-query/m-p/395448#M6706</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-06-25T13:13:44Z</dc:date>
    </item>
  </channel>
</rss>

