<?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: Question about computations in event types in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Question-about-computations-in-event-types/m-p/188778#M54393</link>
    <description>&lt;P&gt;Sorry, I was basing my (incorrect) comment on the following quote from &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.3/Knowledge/Abouteventtypes"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.3/Knowledge/Abouteventtypes&lt;/A&gt; - &lt;/P&gt;

&lt;P&gt;"...you can save any search as an event type."&lt;/P&gt;

&lt;P&gt;Sometimes the doc contradicts itself, apparently. Sorry about the wild goose chase.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Aug 2014 16:47:36 GMT</pubDate>
    <dc:creator>aweitzman</dc:creator>
    <dc:date>2014-08-20T16:47:36Z</dc:date>
    <item>
      <title>Question about computations in event types</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Question-about-computations-in-event-types/m-p/188774#M54389</link>
      <description>&lt;P&gt;I was trying to create a tag/eventtype/equivilent for a message length checksum in our logfiles and it seems eventtypes cannot have subsearches.&lt;/P&gt;

&lt;P&gt;Log Entry:  &lt;CODE&gt;20140815143255713732 R 0004 ,OK)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Fields: &lt;CODE&gt;time, rw_mode, message_length, message&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Each log entry writes out the number of bytes expected followed by the message received, and I was trying to tag to make sure that these two numbers match.&lt;/P&gt;

&lt;P&gt;Search: &lt;CODE&gt;sourcetype=mip | eval msglength=len(message) | search msglength!=message_length&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Edit&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;What I am trying to find out I guess is if there is something (field, tag, eventtype, configuration, don't care) which allows me to just calculate these values on indexing and store what I am guessing would be a "calculated field".  This use case aside it would be nice to be able to do a validation test on log entries and flag the broken ones.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2014 15:39:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Question-about-computations-in-event-types/m-p/188774#M54389</guid>
      <dc:creator>agoebel</dc:creator>
      <dc:date>2014-08-20T15:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: Question about computations in event types</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Question-about-computations-in-event-types/m-p/188775#M54390</link>
      <description>&lt;P&gt;All tagging and event type calculation happens at search time. You should be able to take any search and turn it into an event type.&lt;/P&gt;

&lt;P&gt;Does the search you posted work from the search bar? I would have guessed that you'd need to use &lt;CODE&gt;where&lt;/CODE&gt; instead of &lt;CODE&gt;search&lt;/CODE&gt; in the third clause to get the results you want.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2014 16:33:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Question-about-computations-in-event-types/m-p/188775#M54390</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2014-08-20T16:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Question about computations in event types</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Question-about-computations-in-event-types/m-p/188776#M54391</link>
      <description>&lt;P&gt;It does work in the search bar, when I go to save it as an eventtype I get an error though.  I will try out where&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2014 16:35:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Question-about-computations-in-event-types/m-p/188776#M54391</guid>
      <dc:creator>agoebel</dc:creator>
      <dc:date>2014-08-20T16:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: Question about computations in event types</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Question-about-computations-in-event-types/m-p/188777#M54392</link>
      <description>&lt;P&gt;That's not going to work as-is because there's a pipe in your search.&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.3/Knowledge/Classifyandgroupsimilarevents#Important_event_type_definition_restrictions"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.3/Knowledge/Classifyandgroupsimilarevents#Important_event_type_definition_restrictions&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;However, nothing's stopping you from defining a calculated field &lt;CODE&gt;msglength=len(message)&lt;/CODE&gt; and moving the comparison into the base search. Then your whole search has no more pipes and can be stored in an event type.&lt;BR /&gt;
Note, this kind of search isn't going to be fast because Splunk has to load the entire event, calculate the length, and then filter.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2014 16:38:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Question-about-computations-in-event-types/m-p/188777#M54392</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-08-20T16:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Question about computations in event types</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Question-about-computations-in-event-types/m-p/188778#M54393</link>
      <description>&lt;P&gt;Sorry, I was basing my (incorrect) comment on the following quote from &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.3/Knowledge/Abouteventtypes"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.3/Knowledge/Abouteventtypes&lt;/A&gt; - &lt;/P&gt;

&lt;P&gt;"...you can save any search as an event type."&lt;/P&gt;

&lt;P&gt;Sometimes the doc contradicts itself, apparently. Sorry about the wild goose chase.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2014 16:47:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Question-about-computations-in-event-types/m-p/188778#M54393</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2014-08-20T16:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Question about computations in event types</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Question-about-computations-in-event-types/m-p/188779#M54394</link>
      <description>&lt;P&gt;My big concern is that this calculation must be performed per entry per search. Since the message length of a given entry is static, it seems like there should be a way to do a calculation when the event is getting indexed. I have updated the question.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2014 17:41:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Question-about-computations-in-event-types/m-p/188779#M54394</guid>
      <dc:creator>agoebel</dc:creator>
      <dc:date>2014-08-20T17:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Question about computations in event types</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Question-about-computations-in-event-types/m-p/188780#M54395</link>
      <description>&lt;P&gt;No worries, I had actually tried it before I asked the question since I also read that doc. &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2014 17:44:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Question-about-computations-in-event-types/m-p/188780#M54395</guid>
      <dc:creator>agoebel</dc:creator>
      <dc:date>2014-08-20T17:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: Question about computations in event types</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Question-about-computations-in-event-types/m-p/188781#M54396</link>
      <description>&lt;P&gt;It seems that what I am trying to do is exactly why data models exist. Or other ways to calculate fields in props.conf I believe.  Still, the question of if there is a way to compute this value once at index time remains open.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2014 18:34:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Question-about-computations-in-event-types/m-p/188781#M54396</guid>
      <dc:creator>agoebel</dc:creator>
      <dc:date>2014-08-20T18:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: Question about computations in event types</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Question-about-computations-in-event-types/m-p/188782#M54397</link>
      <description>&lt;P&gt;Even data models are expressed at search time rather than index time, though, which means your larger concern is still an issue. But it may be an easier way of handling what you're trying to do.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2014 18:53:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Question-about-computations-in-event-types/m-p/188782#M54397</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2014-08-20T18:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Question about computations in event types</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Question-about-computations-in-event-types/m-p/188783#M54398</link>
      <description>&lt;P&gt;At index-time you basically have the expressive power of regexes. That means you cannot do maths or even count, hence you cannot calculate the length of a field and index that value... all you can do is index the field itself. That might make filtering by its length a bit faster, no real-world experience with that though.&lt;/P&gt;

&lt;P&gt;Are you trying to detect faulty transmissions? If so, going through each event once would be enough... schedule a search for this that triggers some alert if a bad event has occurred, and there's no need to do any index-time calculations at all because you only search once.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2014 19:15:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Question-about-computations-in-event-types/m-p/188783#M54398</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-08-20T19:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: Question about computations in event types</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Question-about-computations-in-event-types/m-p/188784#M54399</link>
      <description>&lt;P&gt;I was under the impression that "accelerated" models had some sort of caching? Ah well, question remains open.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2014 19:32:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Question-about-computations-in-event-types/m-p/188784#M54399</guid>
      <dc:creator>agoebel</dc:creator>
      <dc:date>2014-08-20T19:32:33Z</dc:date>
    </item>
  </channel>
</rss>

