<?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 How to edit my search to use a custom field created with eval in my time chart search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-use-a-custom-field-created-with-eval-in/m-p/245760#M73270</link>
    <description>&lt;P&gt;I have a search that comes up with a score based off a custom formula from nessus scan results. I want to plot that vulnscore over the past 90 days IE the score from 0-30/30-60/60-90. Can anyone provide a little guidance on how I can make use of timechart with a custom eval field rather than simply running a search and using those results in the timechart. Listed below is my base search. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=network sourcetype=nessus severity!=informational signature!=*Windows* signature!=*Adobe* signature!=*Java* signature_family!="Windows : Microsoft Bulletins" signature_family!="Red Hat Local Security Checks" signature!="Google Chrome*" signature!="Firefox*" signature!="MS*" signature!="Flash Player*" signature!="Solaris*" 
| dedup dest_dns signature_id 
|stats count by signature_id cvss_base_score 
|eval  scoreadjust=floor(cvss_base_score) 
| eval scoreadjust=round(pow(scoreadjust * 0.1, 3)*10,2)
|  eval riskscore=count*scoreadjust/5500
| stats sum(riskscore) as VulnScore 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 24 Aug 2016 21:41:24 GMT</pubDate>
    <dc:creator>trevorr2004</dc:creator>
    <dc:date>2016-08-24T21:41:24Z</dc:date>
    <item>
      <title>How to edit my search to use a custom field created with eval in my time chart search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-use-a-custom-field-created-with-eval-in/m-p/245760#M73270</link>
      <description>&lt;P&gt;I have a search that comes up with a score based off a custom formula from nessus scan results. I want to plot that vulnscore over the past 90 days IE the score from 0-30/30-60/60-90. Can anyone provide a little guidance on how I can make use of timechart with a custom eval field rather than simply running a search and using those results in the timechart. Listed below is my base search. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=network sourcetype=nessus severity!=informational signature!=*Windows* signature!=*Adobe* signature!=*Java* signature_family!="Windows : Microsoft Bulletins" signature_family!="Red Hat Local Security Checks" signature!="Google Chrome*" signature!="Firefox*" signature!="MS*" signature!="Flash Player*" signature!="Solaris*" 
| dedup dest_dns signature_id 
|stats count by signature_id cvss_base_score 
|eval  scoreadjust=floor(cvss_base_score) 
| eval scoreadjust=round(pow(scoreadjust * 0.1, 3)*10,2)
|  eval riskscore=count*scoreadjust/5500
| stats sum(riskscore) as VulnScore 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Aug 2016 21:41:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-use-a-custom-field-created-with-eval-in/m-p/245760#M73270</guid>
      <dc:creator>trevorr2004</dc:creator>
      <dc:date>2016-08-24T21:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to use a custom field created with eval in my time chart search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-use-a-custom-field-created-with-eval-in/m-p/245761#M73271</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=network sourcetype=nessus severity!=informational signature!=*Windows* signature!=*Adobe* signature!=*Java* signature_family!="Windows : Microsoft Bulletins" signature_family!="Red Hat Local Security Checks" signature!="Google Chrome*" signature!="Firefox*" signature!="MS*" signature!="Flash Player*" signature!="Solaris*"  earliest=-90d@d 
| dedup dest_dns signature_id 
| eval range=case(_time&amp;gt;relative_time(now(), "-90d@d") AND _time&amp;lt;relative_time(now(), "-60d@d"), "60-90 days", _time&amp;gt;relative_time(now(), "-60d@d") AND _time&amp;lt;relative_time(now(), "-30d@d"), "30-60 days", _time&amp;gt;relative_time(now(), "-30d@d"), "0-30 days", 1=1, "UNK")
| stats count by range signature_id cvss_base_score 
| eval  scoreadjust=floor(cvss_base_score) 
| eval scoreadjust=round(pow(scoreadjust * 0.1, 3)*10,2)
| eval riskscore=count*scoreadjust/5500
| stats sum(riskscore) as VulnScore by range
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Aug 2016 22:34:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-use-a-custom-field-created-with-eval-in/m-p/245761#M73271</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-24T22:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to use a custom field created with eval in my time chart search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-use-a-custom-field-created-with-eval-in/m-p/245762#M73272</link>
      <description>&lt;P&gt;This worked perfectly for a line graph. Do you have any suggestions on how I could use this same search to use the single value to give just a comparison from previous months?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2016 15:51:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-use-a-custom-field-created-with-eval-in/m-p/245762#M73272</guid>
      <dc:creator>trevorr2004</dc:creator>
      <dc:date>2016-08-25T15:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to use a custom field created with eval in my time chart search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-use-a-custom-field-created-with-eval-in/m-p/245763#M73273</link>
      <description>&lt;P&gt;Try this for the Prev Month comparison (I assume you are referring to trend in single value)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=network sourcetype=nessus severity!=informational signature!=*Windows* signature!=*Adobe* signature!=*Java* signature_family!="Windows : Microsoft Bulletins" signature_family!="Red Hat Local Security Checks" signature!="Google Chrome*" signature!="Firefox*" signature!="MS*" signature!="Flash Player*" signature!="Solaris*"  earliest=-60d@d 
 | dedup dest_dns signature_id 
 | bin span=1mon _time
 | stats count by _time signature_id cvss_base_score 
 | eval  scoreadjust=floor(cvss_base_score) 
 | eval scoreadjust=round(pow(scoreadjust * 0.1, 3)*10,2)
 | eval riskscore=count*scoreadjust/5500
 | stats sum(riskscore) as VulnScore by _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Aug 2016 16:09:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-use-a-custom-field-created-with-eval-in/m-p/245763#M73273</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-25T16:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to use a custom field created with eval in my time chart search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-use-a-custom-field-created-with-eval-in/m-p/245764#M73274</link>
      <description>&lt;P&gt;This worked also. Final question, say I have for instance an eval&lt;/P&gt;

&lt;P&gt;eval PatchScorePerHost=PatchScore/5550&lt;/P&gt;

&lt;P&gt;and I don't need to sum but need to plot that in timetables also. Is there any function of the stat command to just plot the output of the final eval. Basically I am working on creating a risk score that we can track in splunk.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2016 16:32:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-use-a-custom-field-created-with-eval-in/m-p/245764#M73274</guid>
      <dc:creator>trevorr2004</dc:creator>
      <dc:date>2016-08-25T16:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to use a custom field created with eval in my time chart search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-use-a-custom-field-created-with-eval-in/m-p/245765#M73275</link>
      <description>&lt;P&gt;Try using &lt;CODE&gt;values(PatchScorePerHost)&lt;/CODE&gt; for a dedup'd  list OR &lt;CODE&gt;list(PatchScorePerHost)&lt;/CODE&gt; for all entries&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2016 17:42:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-use-a-custom-field-created-with-eval-in/m-p/245765#M73275</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-25T17:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to use a custom field created with eval in my time chart search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-use-a-custom-field-created-with-eval-in/m-p/245766#M73276</link>
      <description>&lt;P&gt;I was able to rearrange my equation like such with your guidance. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=network sourcetype=nessus severity!=informational signature!=*Windows* signature!=*Adobe* signature!=*Java* signature_family!="Windows : Microsoft Bulletins" signature_family!="Red Hat Local Security Checks" signature!="Google Chrome*" signature!="Firefox*" signature!="MS*" signature!="Flash Player*" signature!="Solaris*"     
| dedup dest_dns signature_id 
| bin span=1mon _time   
| stats count by _time signature_id cvss_base_score 
| eval  scoreadjust=floor(cvss_base_score)    
| eval scoreadjust=round(pow(scoreadjust,3)/100)   
| eval riskscore=count*scoreadjust/5500 
| eval my_time=_time 
| convert timeformat="%m-%Y" ctime(my_time)   
| stats  sum(riskscore) as VulnScore by my_time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Instead of using the static number of 5500, is there a way I could dynamically count my host scan then use that in an eval statement so&lt;/P&gt;

&lt;P&gt;stats dc(dest_dns) and then use that instead of the 5500?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2016 21:24:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-use-a-custom-field-created-with-eval-in/m-p/245766#M73276</guid>
      <dc:creator>trevorr2004</dc:creator>
      <dc:date>2016-08-25T21:24:02Z</dc:date>
    </item>
  </channel>
</rss>

