<?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 we use the eval command to calculate fields across different sourcetypes? What is the best approach? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-we-use-the-eval-command-to-calculate-fields-across-different/m-p/54760#M13360</link>
    <description>&lt;P&gt;It would probably help to see the examples of what you have tried.&lt;/P&gt;</description>
    <pubDate>Thu, 17 May 2012 17:17:56 GMT</pubDate>
    <dc:creator>sdaniels</dc:creator>
    <dc:date>2012-05-17T17:17:56Z</dc:date>
    <item>
      <title>Can we use the eval command to calculate fields across different sourcetypes? What is the best approach?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-we-use-the-eval-command-to-calculate-fields-across-different/m-p/54759#M13359</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm trying to do simple calculations with the eval command but the fields I need to calculate are spread across a number sourcetypes. The query would ultimately have a variable for user ID and would calculate data specific to the user located across multiple sourcetypes&lt;/P&gt;

&lt;P&gt;Would I want to use a combination of transaction/subsearches? I've tried both and a couple other approaches but I'm not sure if my issue is conceptual or with my syntax. Any suggestions?&lt;/P&gt;

&lt;P&gt;Thanks for any help,&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2012 16:43:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-we-use-the-eval-command-to-calculate-fields-across-different/m-p/54759#M13359</guid>
      <dc:creator>ewm87</dc:creator>
      <dc:date>2012-05-17T16:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use the eval command to calculate fields across different sourcetypes? What is the best approach?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-we-use-the-eval-command-to-calculate-fields-across-different/m-p/54760#M13360</link>
      <description>&lt;P&gt;It would probably help to see the examples of what you have tried.&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2012 17:17:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-we-use-the-eval-command-to-calculate-fields-across-different/m-p/54760#M13360</guid>
      <dc:creator>sdaniels</dc:creator>
      <dc:date>2012-05-17T17:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use the eval command to calculate fields across different sourcetypes? What is the best approach?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-we-use-the-eval-command-to-calculate-fields-across-different/m-p/54761#M13361</link>
      <description>&lt;P&gt;Well, I can give an example but in all honesty I'm not sure if my issue is conceptual? &lt;/P&gt;

&lt;P&gt;var1 would be a field in source1&lt;BR /&gt;
var2 would be a field in source2&lt;/P&gt;

&lt;P&gt;(sourcetype="source1") OR (sourcetype="source2")| user_id="ID" | eval percentage=(var1/var2) | top percentage&lt;/P&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;P&gt;sourcetype="*" user_id="ID" | eval percentage=(var1/var2) | top percentage&lt;/P&gt;

&lt;P&gt;Not sure if this clarifies...&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2012 17:47:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-we-use-the-eval-command-to-calculate-fields-across-different/m-p/54761#M13361</guid>
      <dc:creator>ewm87</dc:creator>
      <dc:date>2012-05-17T17:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use the eval command to calculate fields across different sourcetypes? What is the best approach?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-we-use-the-eval-command-to-calculate-fields-across-different/m-p/54762#M13362</link>
      <description>&lt;P&gt;I don't think it's a conceptual issue, that should be fine. As long as the first part of your search when you narrow it down (sourcetype=* user=x ) that the user exists in both source events.  Otherwise, the field you try to calculate won't return in the result set and when eval is applied you'll get nothing. &lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2012 18:18:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-we-use-the-eval-command-to-calculate-fields-across-different/m-p/54762#M13362</guid>
      <dc:creator>sdaniels</dc:creator>
      <dc:date>2012-05-17T18:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use the eval command to calculate fields across different sourcetypes? What is the best approach?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-we-use-the-eval-command-to-calculate-fields-across-different/m-p/54763#M13363</link>
      <description>&lt;P&gt;Use the coalesce() function. This will allow you to group events from multiple sourcetypes.&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2012 18:33:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-we-use-the-eval-command-to-calculate-fields-across-different/m-p/54763#M13363</guid>
      <dc:creator>mship</dc:creator>
      <dc:date>2012-05-17T18:33:59Z</dc:date>
    </item>
  </channel>
</rss>

