<?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: where clause with a variable in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/where-clause-with-a-variable/m-p/189725#M54640</link>
    <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;Not able to understand the question. Can you please elaborate?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Vishal&lt;/P&gt;</description>
    <pubDate>Mon, 18 May 2015 10:50:55 GMT</pubDate>
    <dc:creator>vganjare</dc:creator>
    <dc:date>2015-05-18T10:50:55Z</dc:date>
    <item>
      <title>where clause with a variable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/where-clause-with-a-variable/m-p/189724#M54639</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;

&lt;P&gt;I need to get sum of total_revenue where churn=1.&lt;BR /&gt;
I am able to get the count of churn whose churn=1 and total count of chur but not for other variable total_revenue.&lt;BR /&gt;
Can any one help me out to achieve this&lt;/P&gt;

&lt;P&gt;I used the query to get count churn=1 :&lt;BR /&gt;
&lt;STRONG&gt;sourcetype="Customer_Churn"&lt;BR /&gt;&lt;BR /&gt;
| eval CHURN = if(CHURN="1",1,0) &lt;BR /&gt;
| stats sum(CHURN) as Churned_Customers,count(CHURN) as Total_Churn by PLACEMENT&lt;/STRONG&gt;&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Santhosh.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:54:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/where-clause-with-a-variable/m-p/189724#M54639</guid>
      <dc:creator>SanthoshSreshta</dc:creator>
      <dc:date>2020-09-28T19:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: where clause with a variable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/where-clause-with-a-variable/m-p/189725#M54640</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;Not able to understand the question. Can you please elaborate?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Vishal&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2015 10:50:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/where-clause-with-a-variable/m-p/189725#M54640</guid>
      <dc:creator>vganjare</dc:creator>
      <dc:date>2015-05-18T10:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: where clause with a variable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/where-clause-with-a-variable/m-p/189726#M54641</link>
      <description>&lt;P&gt;I need the sum(total_revenue) where churn=1.&lt;BR /&gt;
I have two variable total revenue and churn. churn has two values 1 and 0.&lt;BR /&gt;
like in SQL: select sum(total_variable) from my_source_table where churn=1&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:54:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/where-clause-with-a-variable/m-p/189726#M54641</guid>
      <dc:creator>SanthoshSreshta</dc:creator>
      <dc:date>2020-09-28T19:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: where clause with a variable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/where-clause-with-a-variable/m-p/189727#M54642</link>
      <description>&lt;P&gt;change stats to eventstats.  Splunk has &lt;STRONG&gt;where&lt;/STRONG&gt; command @ &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.2/SearchReference/Where"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.2/SearchReference/Where&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2015 10:59:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/where-clause-with-a-variable/m-p/189727#M54642</guid>
      <dc:creator>vganjare</dc:creator>
      <dc:date>2015-05-18T10:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: where clause with a variable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/where-clause-with-a-variable/m-p/189728#M54643</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/140538"&gt;@vganjare&lt;/a&gt;&lt;BR /&gt;
&lt;STRONG&gt;sourcetype="Customer_Churn"&lt;BR /&gt;&lt;BR /&gt;
| eventstats  sum(Total_Revenue) as ff by PLACEMENT&lt;BR /&gt;
| where CHURN="1" &lt;BR /&gt;
| stats sum(Total_Revenue) by  PLACEMENT&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:54:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/where-clause-with-a-variable/m-p/189728#M54643</guid>
      <dc:creator>SanthoshSreshta</dc:creator>
      <dc:date>2020-09-28T19:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: where clause with a variable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/where-clause-with-a-variable/m-p/189729#M54644</link>
      <description>&lt;P&gt;@vganjare, Can we able to get sum(total_revenue)  without any condition. in the same query.&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2015 11:09:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/where-clause-with-a-variable/m-p/189729#M54644</guid>
      <dc:creator>SanthoshSreshta</dc:creator>
      <dc:date>2015-05-18T11:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: where clause with a variable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/where-clause-with-a-variable/m-p/189730#M54645</link>
      <description>&lt;P&gt;using eventstats, all the events are updated with new fields i.e. if you use eventstats sum(Total_Revenue) , then all the events will have same value for sum field.  More @ &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.2/SearchReference/Eventstats"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.2/SearchReference/Eventstats&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2015 11:52:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/where-clause-with-a-variable/m-p/189730#M54645</guid>
      <dc:creator>vganjare</dc:creator>
      <dc:date>2015-05-18T11:52:44Z</dc:date>
    </item>
  </channel>
</rss>

