<?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: How to make an existing field equal a certain value based on the value of another field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-an-existing-field-equal-a-certain-value-based-on-the/m-p/268377#M80721</link>
    <description>&lt;P&gt;Hi, provided 'my search' is correct, I can't see anything wrong with the eval or the stats count.&lt;BR /&gt;
Maybe add a default value for your case with &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval severity = case(impact = Vulnerable, "high", impact = "Not Vulnerable", "medium", 1=1, "other")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And see if that's returning anything.&lt;/P&gt;</description>
    <pubDate>Wed, 09 Dec 2015 16:49:31 GMT</pubDate>
    <dc:creator>javiergn</dc:creator>
    <dc:date>2015-12-09T16:49:31Z</dc:date>
    <item>
      <title>How to make an existing field equal a certain value based on the value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-an-existing-field-equal-a-certain-value-based-on-the/m-p/268376#M80720</link>
      <description>&lt;P&gt;I have a need to make an existing field a value if another field is a certain value.  Example:&lt;/P&gt;

&lt;P&gt;what I want to do:&lt;BR /&gt;
&lt;CODE&gt;impact = Vulnerable&lt;/CODE&gt; then &lt;CODE&gt;severity = high&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;impact = Potentially Vulnerable&lt;/CODE&gt; then &lt;CODE&gt;severity = medium&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Currently each of the &lt;STRONG&gt;impact&lt;/STRONG&gt; fields come in as high, medium or low.  We're looking to make them standard and trigger our Splunk ES to set the Urgency based on the severity we tell it.&lt;/P&gt;

&lt;P&gt;I've tried the below search but nothing returns in the stats tab:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;'my search' | eval severity = case(impact = Vulnerable, "high", impact = "Not Vulnerable", "medium") | stats count by impact, severity
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Dec 2015 15:52:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-an-existing-field-equal-a-certain-value-based-on-the/m-p/268376#M80720</guid>
      <dc:creator>wtaylor149</dc:creator>
      <dc:date>2015-12-09T15:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to make an existing field equal a certain value based on the value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-an-existing-field-equal-a-certain-value-based-on-the/m-p/268377#M80721</link>
      <description>&lt;P&gt;Hi, provided 'my search' is correct, I can't see anything wrong with the eval or the stats count.&lt;BR /&gt;
Maybe add a default value for your case with &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval severity = case(impact = Vulnerable, "high", impact = "Not Vulnerable", "medium", 1=1, "other")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And see if that's returning anything.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2015 16:49:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-an-existing-field-equal-a-certain-value-based-on-the/m-p/268377#M80721</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2015-12-09T16:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to make an existing field equal a certain value based on the value of another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-an-existing-field-equal-a-certain-value-based-on-the/m-p/268378#M80722</link>
      <description>&lt;P&gt;Much appreciate the quick response however this is not working.  The severity is coming up as "other".  It is not picking up the eval statements.&lt;/P&gt;

&lt;P&gt;I modified the eval statement slightly and it looks like it's working.&lt;BR /&gt;
|  eval severity = case(impact = "Vulnerable", "high", impact = "Not Vulnerable", "medium", 1=1, "other") | stats count by impact, severity&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2015 17:11:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-an-existing-field-equal-a-certain-value-based-on-the/m-p/268378#M80722</guid>
      <dc:creator>wtaylor149</dc:creator>
      <dc:date>2015-12-09T17:11:53Z</dc:date>
    </item>
  </channel>
</rss>

