<?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: pivot | where in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/pivot-where/m-p/164405#M3625</link>
    <description>&lt;P&gt;@somesoni2: The problem is that the 'where' clause isn't a legal operator in the constraints object.&lt;/P&gt;</description>
    <pubDate>Wed, 14 May 2014 19:33:35 GMT</pubDate>
    <dc:creator>kensternberg</dc:creator>
    <dc:date>2014-05-14T19:33:35Z</dc:date>
    <item>
      <title>pivot | where</title>
      <link>https://community.splunk.com/t5/Reporting/pivot-where/m-p/164402#M3622</link>
      <description>&lt;P&gt;I want to use a 'where' clause (which allows the comparison of two fields) as a pivot constraint.  My original search is &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=maillog (event=SEND OR event=RECEIVE)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which gives me all the successful mail handling events.  The input source breaks out the root domain of the sender and receiver into individual fields, and I want to be able to say&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where sender_domain=receiver_domain
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In a standard search, this was easy.  I'd like to use this in pivot, but I can't figure out how to make the 'where' clause a child constraint of the main search, so I can say "show me the maillog of internal communications."&lt;/P&gt;

&lt;P&gt;Help, please?&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2014 16:46:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/pivot-where/m-p/164402#M3622</guid>
      <dc:creator>kensternberg</dc:creator>
      <dc:date>2014-05-14T16:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: pivot | where</title>
      <link>https://community.splunk.com/t5/Reporting/pivot-where/m-p/164403#M3623</link>
      <description>&lt;P&gt;You can create a Child to your data model and add Child object. In Child object you can specify your where clause as "Additional Constraints". Is that you're looking for?&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2014 18:26:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/pivot-where/m-p/164403#M3623</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-05-14T18:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: pivot | where</title>
      <link>https://community.splunk.com/t5/Reporting/pivot-where/m-p/164404#M3624</link>
      <description>&lt;P&gt;It turns out you can't create a &lt;CODE&gt;where&lt;/CODE&gt; clause in Pivot.&lt;/P&gt;

&lt;P&gt;But, you can create a calculated field.  In the Data Model Editor, Add Attribute -&amp;gt; Eval Expression.  I used the field name &lt;CODE&gt;is_internal_communication&lt;/CODE&gt;, and an evaluation &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;if (sender_domain = receiver_domain, 1, 0)  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;After previewing and saving, I was able to create a new child object with the constraint &lt;CODE&gt;is_internal_communication = 1&lt;/CODE&gt;, and obviously I could add a child object with the constraint &lt;CODE&gt;in_internal_communication = 0&lt;/CODE&gt; for external communications.&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2014 18:57:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/pivot-where/m-p/164404#M3624</guid>
      <dc:creator>kensternberg</dc:creator>
      <dc:date>2014-05-14T18:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: pivot | where</title>
      <link>https://community.splunk.com/t5/Reporting/pivot-where/m-p/164405#M3625</link>
      <description>&lt;P&gt;@somesoni2: The problem is that the 'where' clause isn't a legal operator in the constraints object.&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2014 19:33:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/pivot-where/m-p/164405#M3625</guid>
      <dc:creator>kensternberg</dc:creator>
      <dc:date>2014-05-14T19:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: pivot | where</title>
      <link>https://community.splunk.com/t5/Reporting/pivot-where/m-p/164406#M3626</link>
      <description>&lt;P&gt;But you will not need to specify 'where' keyword. You can just specify the condition (" sender_domain=receiver_domain") directly in the "Additional constraints" text area.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:36:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/pivot-where/m-p/164406#M3626</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-28T16:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: pivot | where</title>
      <link>https://community.splunk.com/t5/Reporting/pivot-where/m-p/164407#M3627</link>
      <description>&lt;P&gt;I tried that.  The constraint always wants to treat the right side of the expression as a string, not a field name.  The eval method described in the answer I posted was much more effective.&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2014 20:23:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/pivot-where/m-p/164407#M3627</guid>
      <dc:creator>kensternberg</dc:creator>
      <dc:date>2014-05-14T20:23:24Z</dc:date>
    </item>
  </channel>
</rss>

