<?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: Doing calculations using eval command with fields generated by timechart command. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Doing-calculations-using-eval-command-with-fields-generated-by/m-p/315498#M94442</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Can you please try this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="sample_data" sourcetype="management_sampledata.csv" 
 | timechart count(Ticket_No) as Inflow
 | append 
     [search index="sample_data" sourcetype="management_sampledata.csv" Status=Closed 
     | timechart count(Ticket_No) as "Closed/Cancelled"
     | fillnull]
 | timechart first(*) as *
 | eval Backlog_Total = (Inflow-'Closed/Cancelled')
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have just changed in &lt;CODE&gt;Closed/Cancelled&lt;/CODE&gt; field.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 30 Nov 2017 07:33:39 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2017-11-30T07:33:39Z</dc:date>
    <item>
      <title>Doing calculations using eval command with fields generated by timechart command.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Doing-calculations-using-eval-command-with-fields-generated-by/m-p/315497#M94441</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm doing some search query where I used timechart command that creates fields. Now, what I want to do is to some calculations with this fields using eval command but nothing happens.&lt;/P&gt;

&lt;P&gt;Here's my query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="sample_data" sourcetype="management_sampledata.csv" 
| timechart count(Ticket_No) as Inflow
| append 
    [search index="sample_data" sourcetype="management_sampledata.csv" Status=Closed 
    | timechart count(Ticket_No) as Closed/Cancelled 
    | fillnull]
| timechart first(*) as *
| eval Backlog_Total = (Inflow-Closed/Cancelled)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And here's the result:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3944i491EA1DBF3CBA2FE/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;What I was expecting to happen is a new field named "Backlog_Total" will be created using the eval command.&lt;/P&gt;

&lt;P&gt;I hope someone can help me with this.&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 05:41:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Doing-calculations-using-eval-command-with-fields-generated-by/m-p/315497#M94441</guid>
      <dc:creator>jvmerilla</dc:creator>
      <dc:date>2017-11-30T05:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: Doing calculations using eval command with fields generated by timechart command.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Doing-calculations-using-eval-command-with-fields-generated-by/m-p/315498#M94442</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Can you please try this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="sample_data" sourcetype="management_sampledata.csv" 
 | timechart count(Ticket_No) as Inflow
 | append 
     [search index="sample_data" sourcetype="management_sampledata.csv" Status=Closed 
     | timechart count(Ticket_No) as "Closed/Cancelled"
     | fillnull]
 | timechart first(*) as *
 | eval Backlog_Total = (Inflow-'Closed/Cancelled')
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have just changed in &lt;CODE&gt;Closed/Cancelled&lt;/CODE&gt; field.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 07:33:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Doing-calculations-using-eval-command-with-fields-generated-by/m-p/315498#M94442</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2017-11-30T07:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: Doing calculations using eval command with fields generated by timechart command.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Doing-calculations-using-eval-command-with-fields-generated-by/m-p/315499#M94443</link>
      <description>&lt;P&gt;Hi @kamlesh_vaghela,&lt;/P&gt;

&lt;P&gt;It works!&lt;/P&gt;

&lt;P&gt;Thank you again. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 07:55:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Doing-calculations-using-eval-command-with-fields-generated-by/m-p/315499#M94443</guid>
      <dc:creator>jvmerilla</dc:creator>
      <dc:date>2017-11-30T07:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: Doing calculations using eval command with fields generated by timechart command.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Doing-calculations-using-eval-command-with-fields-generated-by/m-p/315500#M94444</link>
      <description>&lt;P&gt;Glad to help you.&lt;BR /&gt;
Can you please accept the answer to close this question and upvote any comment which helps you.&lt;/P&gt;

&lt;P&gt;Happy Splunking&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 08:07:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Doing-calculations-using-eval-command-with-fields-generated-by/m-p/315500#M94444</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2017-11-30T08:07:45Z</dc:date>
    </item>
  </channel>
</rss>

