<?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: Cab a field be used in stats command that's declared in eval command? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Cab-a-field-be-used-in-stats-command-that-s-declared-in-eval/m-p/380260#M173937</link>
    <description>&lt;P&gt;Let me explain again clearly,&lt;/P&gt;

&lt;P&gt;TFN=Test Field Name, TFE1=TestFieldEntry, TFE2=TestFieldEntry, &lt;BR /&gt;
C=Field found out from Eval, A=Count of values that is found with based on available fields, B=Count of values that is found with based on available fields.  TF has two types of entries.  They are TF1 and TF2 respectively. &lt;/P&gt;

&lt;P&gt;C is calculated like C=A-B.  Used the below query.&lt;/P&gt;

&lt;P&gt;|convert auto(A)|appendcols[|convert auto(B)]|eval C=A-B|table A B C&lt;BR /&gt;
With the above query, I am getting the below result as follows.&lt;BR /&gt;
C     B     A&lt;BR /&gt;
4     5     9&lt;/P&gt;

&lt;P&gt;I need to get the values of C and B using the by clause grouped by TFN to get the result in the following manner.&lt;BR /&gt;
TFN      C      B&lt;BR /&gt;
TFE1     1     2&lt;BR /&gt;
TFE2     4     5&lt;/P&gt;

&lt;P&gt;Please tell me whether you understand this explanation.&lt;/P&gt;</description>
    <pubDate>Wed, 26 Dec 2018 06:17:28 GMT</pubDate>
    <dc:creator>gokikrishnan</dc:creator>
    <dc:date>2018-12-26T06:17:28Z</dc:date>
    <item>
      <title>Cab a field be used in stats command that's declared in eval command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Cab-a-field-be-used-in-stats-command-that-s-declared-in-eval/m-p/380256#M173933</link>
      <description>&lt;P&gt;BaseSearch&amp;gt;|convert auto(A)|appendcols[|convert auto(B)]|eval C=A-B|table A B C&lt;BR /&gt;
This gives the result as &lt;BR /&gt;
A        B            C&lt;BR /&gt;
5        7             12&lt;BR /&gt;
Currently i want the result like as follows&lt;BR /&gt;
TestField        A        B&lt;BR /&gt;
Test1              1         2&lt;BR /&gt;
Test2               4        5&lt;/P&gt;

&lt;P&gt;How do i write a query to get the above result?  I have tried the following things.&lt;BR /&gt;
1)  I have tried to group by TestField in a table&lt;BR /&gt;
2) Tried converting the C to string again as it can be used in stats command again.&lt;/P&gt;

&lt;P&gt;Request you to assist me with regard to the same.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Dec 2018 05:32:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Cab-a-field-be-used-in-stats-command-that-s-declared-in-eval/m-p/380256#M173933</guid>
      <dc:creator>gokikrishnan</dc:creator>
      <dc:date>2018-12-24T05:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Cab a field be used in stats command that's declared in eval command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Cab-a-field-be-used-in-stats-command-that-s-declared-in-eval/m-p/380257#M173934</link>
      <description>&lt;P&gt;@gokikrishnan, trying to understand your requirement in bit more detail&lt;/P&gt;

&lt;P&gt;The first result looks like A+B and not A-B.&lt;BR /&gt;
Do you want to convert the first result to second result or do you have already some events which we can look at?&lt;BR /&gt;
Please provide some sample events and the expected output&lt;/P&gt;</description>
      <pubDate>Mon, 24 Dec 2018 07:53:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Cab-a-field-be-used-in-stats-command-that-s-declared-in-eval/m-p/380257#M173934</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-12-24T07:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: Cab a field be used in stats command that's declared in eval command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Cab-a-field-be-used-in-stats-command-that-s-declared-in-eval/m-p/380258#M173935</link>
      <description>&lt;P&gt;My Bad, Gave the requirement incorrectly.  Sorry.&lt;BR /&gt;
Here A is Total, I have found B.  To find C, I do C=A-B, As of now I am able to get the result as follows:&lt;BR /&gt;
TF    C  B  A&lt;BR /&gt;
TF1  1  2  3&lt;BR /&gt;
TF2  4  5  9&lt;BR /&gt;
Actually need the query to be displayed as follows:&lt;BR /&gt;
TF    C  B&lt;BR /&gt;
T1    1   2&lt;BR /&gt;
T2    4  5&lt;/P&gt;</description>
      <pubDate>Mon, 24 Dec 2018 09:16:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Cab-a-field-be-used-in-stats-command-that-s-declared-in-eval/m-p/380258#M173935</guid>
      <dc:creator>gokikrishnan</dc:creator>
      <dc:date>2018-12-24T09:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: Cab a field be used in stats command that's declared in eval command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Cab-a-field-be-used-in-stats-command-that-s-declared-in-eval/m-p/380259#M173936</link>
      <description>&lt;P&gt;@gokikrishnan,&lt;BR /&gt;
Not sure whether understand you correctly, but based on your inputs, this should give you the expected result&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your current search to get TF,C,B,A|replace TF* with T* in TF|table TF,C,B
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Dec 2018 10:18:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Cab-a-field-be-used-in-stats-command-that-s-declared-in-eval/m-p/380259#M173936</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-12-24T10:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: Cab a field be used in stats command that's declared in eval command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Cab-a-field-be-used-in-stats-command-that-s-declared-in-eval/m-p/380260#M173937</link>
      <description>&lt;P&gt;Let me explain again clearly,&lt;/P&gt;

&lt;P&gt;TFN=Test Field Name, TFE1=TestFieldEntry, TFE2=TestFieldEntry, &lt;BR /&gt;
C=Field found out from Eval, A=Count of values that is found with based on available fields, B=Count of values that is found with based on available fields.  TF has two types of entries.  They are TF1 and TF2 respectively. &lt;/P&gt;

&lt;P&gt;C is calculated like C=A-B.  Used the below query.&lt;/P&gt;

&lt;P&gt;|convert auto(A)|appendcols[|convert auto(B)]|eval C=A-B|table A B C&lt;BR /&gt;
With the above query, I am getting the below result as follows.&lt;BR /&gt;
C     B     A&lt;BR /&gt;
4     5     9&lt;/P&gt;

&lt;P&gt;I need to get the values of C and B using the by clause grouped by TFN to get the result in the following manner.&lt;BR /&gt;
TFN      C      B&lt;BR /&gt;
TFE1     1     2&lt;BR /&gt;
TFE2     4     5&lt;/P&gt;

&lt;P&gt;Please tell me whether you understand this explanation.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Dec 2018 06:17:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Cab-a-field-be-used-in-stats-command-that-s-declared-in-eval/m-p/380260#M173937</guid>
      <dc:creator>gokikrishnan</dc:creator>
      <dc:date>2018-12-26T06:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Cab a field be used in stats command that's declared in eval command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Cab-a-field-be-used-in-stats-command-that-s-declared-in-eval/m-p/380261#M173938</link>
      <description>&lt;P&gt;I got answer for the same.  Thanks Renjith and All.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Dec 2018 07:26:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Cab-a-field-be-used-in-stats-command-that-s-declared-in-eval/m-p/380261#M173938</guid>
      <dc:creator>gokikrishnan</dc:creator>
      <dc:date>2018-12-26T07:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: Cab a field be used in stats command that's declared in eval command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Cab-a-field-be-used-in-stats-command-that-s-declared-in-eval/m-p/380262#M173939</link>
      <description>&lt;P&gt;@gokikrishnan - We converted the apparently correct comment to an answer.  Please accept the answer if that is what got you your solution.  If not, then please post your own solution, so that others may benefit, and accept your own answer.  Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 31 Dec 2018 19:52:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Cab-a-field-be-used-in-stats-command-that-s-declared-in-eval/m-p/380262#M173939</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-12-31T19:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Cab a field be used in stats command that's declared in eval command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Cab-a-field-be-used-in-stats-command-that-s-declared-in-eval/m-p/380263#M173940</link>
      <description>&lt;P&gt;Your descriptions (I have read all of them) make no sense at all.  Show is some sample events, show us a mockup of the desired final output and THEN try to explain the steps required to get from data to final output.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jan 2019 21:34:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Cab-a-field-be-used-in-stats-command-that-s-declared-in-eval/m-p/380263#M173940</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-01-01T21:34:31Z</dc:date>
    </item>
  </channel>
</rss>

