<?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: Can eval evaluate Cosines? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-eval-evaluate-Cosines/m-p/29290#M5890</link>
    <description>&lt;P&gt;By the way, I haven't actually tried this so my above answer may need some tweaking.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Feb 2014 22:35:23 GMT</pubDate>
    <dc:creator>sdorich</dc:creator>
    <dc:date>2014-02-06T22:35:23Z</dc:date>
    <item>
      <title>Can eval evaluate Cosines?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-eval-evaluate-Cosines/m-p/29285#M5885</link>
      <description>&lt;P&gt;Can eval evaluate Cosines?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2011 12:49:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-eval-evaluate-Cosines/m-p/29285#M5885</guid>
      <dc:creator>davecroto</dc:creator>
      <dc:date>2011-06-16T12:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: Can eval evaluate Cosines?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-eval-evaluate-Cosines/m-p/29286#M5886</link>
      <description>&lt;P&gt;No, it cannot.&lt;/P&gt;

&lt;P&gt;A complete list of commands supported by &lt;CODE&gt;eval&lt;/CODE&gt; is available here: &lt;A href="http://www.splunk.com/base/Documentation/latest/SearchReference/CommonEvalFunctions"&gt;http://www.splunk.com/base/Documentation/latest/SearchReference/CommonEvalFunctions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2011 14:00:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-eval-evaluate-Cosines/m-p/29286#M5886</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-06-16T14:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: Can eval evaluate Cosines?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-eval-evaluate-Cosines/m-p/29287#M5887</link>
      <description>&lt;P&gt;This could be a good candidate for a custom search command.  See &lt;A href="http://www.splunk.com/base/Documentation/latest/SearchReference/Aboutcustomsearchcommands"&gt;http://www.splunk.com/base/Documentation/latest/SearchReference/Aboutcustomsearchcommands&lt;/A&gt; for info on how to roll your own.&lt;/P&gt;

&lt;P&gt;Something else to consider is filing an ER (Enhancement request) for either providing additional mathematical functions in eval (If you're going to do cosine -- you might as well do sine, secant, and tangent) or providing a way to create user-defined &lt;CODE&gt;eval&lt;/CODE&gt; functions.   (Assuming, of course, that the API for an &lt;CODE&gt;eval&lt;/CODE&gt; UDF would have any benefit at all over a custom search command.  I am not certain if this is the case or not)&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2011 15:15:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-eval-evaluate-Cosines/m-p/29287#M5887</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2011-06-16T15:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Can eval evaluate Cosines?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-eval-evaluate-Cosines/m-p/29288#M5888</link>
      <description>&lt;P&gt;Approximate functions like cosine or sine using its Taylor series! &lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.math.sc.edu/%7Egirardi/m142/handouts/10sTaylorPolySeries.pdf" target="_blank"&gt;http://www.math.sc.edu/~girardi/m142/handouts/10sTaylorPolySeries.pdf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Write a stanza in macros.conf that defines cosine as an approximation using its Taylor series.&lt;/P&gt;

&lt;P&gt;Ex:&lt;/P&gt;

&lt;P&gt;[cosine(1)]&lt;BR /&gt;
args=x&lt;BR /&gt;
description = calculates an approximate value for cosine of x&lt;BR /&gt;
definition = eval cosineX=(1 - ((x*x)/2) + ((x*x*x*x)/(4*3*2)) - ....)&lt;/P&gt;

&lt;P&gt;And add as many terms as you'd like - as you add more terms your approximation of cosine of x will start to converge to the actual value. &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:49:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-eval-evaluate-Cosines/m-p/29288#M5888</guid>
      <dc:creator>sdorich</dc:creator>
      <dc:date>2020-09-28T15:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can eval evaluate Cosines?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-eval-evaluate-Cosines/m-p/29289#M5889</link>
      <description>&lt;P&gt;I forgot to add money signs around all the x terms in the definition above - each x should be surrounded (i.e. $x$*$x$...)&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2014 22:32:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-eval-evaluate-Cosines/m-p/29289#M5889</guid>
      <dc:creator>sdorich</dc:creator>
      <dc:date>2014-02-06T22:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: Can eval evaluate Cosines?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-eval-evaluate-Cosines/m-p/29290#M5890</link>
      <description>&lt;P&gt;By the way, I haven't actually tried this so my above answer may need some tweaking.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2014 22:35:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-eval-evaluate-Cosines/m-p/29290#M5890</guid>
      <dc:creator>sdorich</dc:creator>
      <dc:date>2014-02-06T22:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: Can eval evaluate Cosines?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-eval-evaluate-Cosines/m-p/29291#M5891</link>
      <description>&lt;P&gt;Basic trigonometric eval functions got added in 6.4.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions#Trigonometry_and_Hyperbolic_functions"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions#Trigonometry_and_Hyperbolic_functions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2016 22:01:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-eval-evaluate-Cosines/m-p/29291#M5891</guid>
      <dc:creator>aljohnson_splun</dc:creator>
      <dc:date>2016-07-21T22:01:23Z</dc:date>
    </item>
  </channel>
</rss>

