<?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: using eval results of a search with my base search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/using-eval-results-of-a-search-with-my-base-search/m-p/509590#M142431</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;maybe this is what you are looking for:&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.5/Knowledge/definecalcfields" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.5/Knowledge/definecalcfields&lt;/A&gt;&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
    <pubDate>Thu, 16 Jul 2020 20:07:47 GMT</pubDate>
    <dc:creator>isoutamo</dc:creator>
    <dc:date>2020-07-16T20:07:47Z</dc:date>
    <item>
      <title>using eval results of a search with my base search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-eval-results-of-a-search-with-my-base-search/m-p/509563#M142424</link>
      <description>&lt;P&gt;I'm currently trying to use the results of my eval fields in my base search&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, I would like for my search to be&lt;/P&gt;&lt;P&gt;index=rapid7 sourcetype=rapid7:nexpose:vuln vuln_age &amp;gt; 30 ratings=high&lt;/P&gt;&lt;P&gt;is there a way that I can do this?&lt;/P&gt;&lt;P&gt;Here's the current&amp;nbsp; code:&lt;/P&gt;&lt;P&gt;index=rapid7 sourcetype=rapid7:nexpose:vuln&lt;BR /&gt;| eval p_date=strptime(vulnerability_date_published, "%Y-%m-%d")&lt;BR /&gt;| eval t_date=now()&lt;BR /&gt;| eval vuln_age= round((t_date - p_date)/86400)&lt;BR /&gt;| eval ratings=case(vulnerability_cvss3_score&amp;gt;0 AND vulnerability_cvss3_score&amp;lt;=3.9, "Low",vulnerability_cvss3_score&amp;gt;3.9 AND vulnerability_cvss3_score&amp;lt;=6.9, "Medium", vulnerability_cvss3_score&amp;gt;6.9 AND vulnerability_cvss3_score&amp;lt;=8.9, "High", vulnerability_cvss3_score &amp;gt; 8.9, "Critical")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 18:20:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-eval-results-of-a-search-with-my-base-search/m-p/509563#M142424</guid>
      <dc:creator>payton_tayvion</dc:creator>
      <dc:date>2020-07-16T18:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: using eval results of a search with my base search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-eval-results-of-a-search-with-my-base-search/m-p/509590#M142431</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;maybe this is what you are looking for:&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.5/Knowledge/definecalcfields" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.5/Knowledge/definecalcfields&lt;/A&gt;&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 20:07:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-eval-results-of-a-search-with-my-base-search/m-p/509590#M142431</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-07-16T20:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: using eval results of a search with my base search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-eval-results-of-a-search-with-my-base-search/m-p/509596#M142435</link>
      <description>&lt;P&gt;It's not possible to use a field before it exists.&amp;nbsp; You can reformat the query like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=rapid7 sourcetype=rapid7:nexpose:vuln (vulnerability_cvss3_score&amp;gt;6.9 AND vulnerability_cvss3_score&amp;lt;=8.9)
| eval p_date=strptime(vulnerability_date_published, "%Y-%m-%d")
| eval t_date=now()
| eval vuln_age= round((t_date - p_date)/86400)
| eval ratings=case(vulnerability_cvss3_score&amp;gt;0 AND vulnerability_cvss3_score&amp;lt;=3.9, "Low",vulnerability_cvss3_score&amp;gt;3.9 AND vulnerability_cvss3_score&amp;lt;=6.9, "Medium", vulnerability_cvss3_score&amp;gt;6.9 AND vulnerability_cvss3_score&amp;lt;=8.9, "High", vulnerability_cvss3_score &amp;gt; 8.9, "Critical")&lt;/LI-CODE&gt;&lt;P&gt;or use a macro like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=rapid7 sourcetype=rapid7:nexpose:vuln `high_cvss`
| eval p_date=strptime(vulnerability_date_published, "%Y-%m-%d")
| eval t_date=now()
| eval vuln_age= round((t_date - p_date)/86400)
| eval ratings=case(vulnerability_cvss3_score&amp;gt;0 AND vulnerability_cvss3_score&amp;lt;=3.9, "Low",vulnerability_cvss3_score&amp;gt;3.9 AND vulnerability_cvss3_score&amp;lt;=6.9, "Medium", `high_cvss`, "High", vulnerability_cvss3_score &amp;gt; 8.9, "Critical")&lt;/LI-CODE&gt;&lt;P&gt;where the macro &lt;FONT face="courier new,courier"&gt;high_cvss&lt;/FONT&gt; is defined as "&lt;FONT face="courier new,courier"&gt;(vulnerability_cvss3_score&amp;gt;6.9 AND vulnerability_cvss3_score&amp;lt;=8.9)&lt;/FONT&gt;".&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 20:26:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-eval-results-of-a-search-with-my-base-search/m-p/509596#M142435</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-07-16T20:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: using eval results of a search with my base search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-eval-results-of-a-search-with-my-base-search/m-p/509826#M142513</link>
      <description>&lt;P&gt;Thanks everyone I was able to find a solution. The search command did exactly what I was looking for. Thanks for the replies everyone&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jul 2020 07:26:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-eval-results-of-a-search-with-my-base-search/m-p/509826#M142513</guid>
      <dc:creator>payton_tayvion</dc:creator>
      <dc:date>2020-07-18T07:26:14Z</dc:date>
    </item>
  </channel>
</rss>

