<?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: Perform calculations on a count of EventTypes in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Perform-calculations-on-a-count-of-EventTypes/m-p/18182#M134</link>
    <description>&lt;P&gt;I would firstly try simplifying the names you are using the &lt;CODE&gt;timechart&lt;/CODE&gt; command, and use something simple like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;OC-Main-player-loaded --&amp;gt; loaded
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then pipe to your &lt;CODE&gt;eval&lt;/CODE&gt; command and use the simplified field labels in your calculation. I have had issues in the past with processing certain field names.&lt;/P&gt;

&lt;P&gt;I would then pipe to &lt;CODE&gt;rename&lt;/CODE&gt; to change the simplified field labels to something more legible.&lt;/P&gt;

&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
    <pubDate>Mon, 04 Feb 2013 13:01:30 GMT</pubDate>
    <dc:creator>MHibbin</dc:creator>
    <dc:date>2013-02-04T13:01:30Z</dc:date>
    <item>
      <title>Perform calculations on a count of EventTypes</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Perform-calculations-on-a-count-of-EventTypes/m-p/18181#M133</link>
      <description>&lt;P&gt;I have having trouble performing basic calculations using Eval. I can do '2*2' but I cannot do this with a count of eventtype.&lt;/P&gt;

&lt;P&gt;I have a search running, to total EventTypes that I created.&lt;/P&gt;

&lt;P&gt;sourcetype=csv | timechart span="1d" , count(eval(eventtype="OC-Main Player_Loaded")) AS OC-Main-player-loaded, count(eval(eventtype="OC-Main User_Interacted")) AS OC-Main-User_Interacted&lt;/P&gt;

&lt;P&gt;This creates a table, showing the time, and then a count of the EventTypes (in this case "OC-Main PlayerLoaded" and "OC-Main UserInteracted").&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://dl.dropbox.com/u/6588335/sa/splunk/data-example.jpg" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;I want to create a 4th column, that would give me a calculation, based on these counts. What I want is a %, but at the moment I can't get anything to work.&lt;/P&gt;

&lt;P&gt;If I add a simple Eval at the end, the result shows. eg...  &lt;STRONG&gt;| eval ocper=(2*2)&lt;/STRONG&gt; shows as 4&lt;BR /&gt;
However, if I try and use the AS event names (eg: OC-Main-player-loaded) nothing shows.&lt;/P&gt;

&lt;P&gt;My guess is, OC-Main-player-loaded is just the name of the table column, and splunk has no concept of what I am trying to multiply. I assume I need to specify that the count should be some sort of field that can be multiplied. How do I do this?&lt;/P&gt;

&lt;P&gt;thanks in advanced.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:13:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Perform-calculations-on-a-count-of-EventTypes/m-p/18181#M133</guid>
      <dc:creator>sportauthority</dc:creator>
      <dc:date>2020-09-28T13:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: Perform calculations on a count of EventTypes</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Perform-calculations-on-a-count-of-EventTypes/m-p/18182#M134</link>
      <description>&lt;P&gt;I would firstly try simplifying the names you are using the &lt;CODE&gt;timechart&lt;/CODE&gt; command, and use something simple like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;OC-Main-player-loaded --&amp;gt; loaded
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then pipe to your &lt;CODE&gt;eval&lt;/CODE&gt; command and use the simplified field labels in your calculation. I have had issues in the past with processing certain field names.&lt;/P&gt;

&lt;P&gt;I would then pipe to &lt;CODE&gt;rename&lt;/CODE&gt; to change the simplified field labels to something more legible.&lt;/P&gt;

&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2013 13:01:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Perform-calculations-on-a-count-of-EventTypes/m-p/18182#M134</guid>
      <dc:creator>MHibbin</dc:creator>
      <dc:date>2013-02-04T13:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: Perform calculations on a count of EventTypes</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Perform-calculations-on-a-count-of-EventTypes/m-p/18183#M135</link>
      <description>&lt;P&gt;Ok, that works. thank you very much. It's probably something I should have tried about 4 hours ago. Instead I have been reading docs, trying examples, looking in the wiki. You live and learn! cheers!&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2013 13:18:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Perform-calculations-on-a-count-of-EventTypes/m-p/18183#M135</guid>
      <dc:creator>sportauthority</dc:creator>
      <dc:date>2013-02-04T13:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: Perform calculations on a count of EventTypes</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Perform-calculations-on-a-count-of-EventTypes/m-p/18184#M136</link>
      <description>&lt;P&gt;No problem, to close this question off, can you mark the answer as accepted with the empty tick beside the answer.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2013 13:36:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Perform-calculations-on-a-count-of-EventTypes/m-p/18184#M136</guid>
      <dc:creator>MHibbin</dc:creator>
      <dc:date>2013-02-04T13:36:31Z</dc:date>
    </item>
  </channel>
</rss>

