<?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 change a field with a numeric value in a CSV input file to a word equivalent at index-time? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-field-with-a-numeric-value-in-a-CSV-input-file/m-p/232582#M68996</link>
    <description>&lt;P&gt;For example, csv field is vulnerability severity (range of 1-10). I want to change that to one of 3 values depending on the numeric value, Moderate, Severe or Critical. I read that Lookup files cannot be used at index-time, so is there an alternative?  &lt;/P&gt;</description>
    <pubDate>Thu, 14 Jan 2016 13:52:50 GMT</pubDate>
    <dc:creator>corosco112</dc:creator>
    <dc:date>2016-01-14T13:52:50Z</dc:date>
    <item>
      <title>How to change a field with a numeric value in a CSV input file to a word equivalent at index-time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-field-with-a-numeric-value-in-a-CSV-input-file/m-p/232582#M68996</link>
      <description>&lt;P&gt;For example, csv field is vulnerability severity (range of 1-10). I want to change that to one of 3 values depending on the numeric value, Moderate, Severe or Critical. I read that Lookup files cannot be used at index-time, so is there an alternative?  &lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2016 13:52:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-field-with-a-numeric-value-in-a-CSV-input-file/m-p/232582#M68996</guid>
      <dc:creator>corosco112</dc:creator>
      <dc:date>2016-01-14T13:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a field with a numeric value in a CSV input file to a word equivalent at index-time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-field-with-a-numeric-value-in-a-CSV-input-file/m-p/232583#M68997</link>
      <description>&lt;P&gt;Hi there! &lt;/P&gt;

&lt;P&gt;If I am understanding this correctly, you have a field called severity and with a range values 1-10, and depending the number, you want to change it to Moderate, Severe or Critical and use it after the change in another search, right?&lt;/P&gt;

&lt;P&gt;If this is the case, you could try something like this:&lt;BR /&gt;
| eval priority= if(severity(your field)&amp;gt;="0" AND severity&amp;lt;5, "Moderate", if (severity &amp;lt;"8" AND severity &amp;gt;= "5", "Severe", if (severity &amp;lt;= "10" AND severity &amp;gt;= 8, "Critical","Unrated")))&lt;/P&gt;

&lt;P&gt;This will set a new field called priority the values 0-4 as Moderate, values from 5-8  SEvere and values from 8-10 Critical. &lt;/P&gt;

&lt;P&gt;I hope It works, If I am missunderstanding something or it doesn't work write it and I will try to help you more &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2016 16:44:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-field-with-a-numeric-value-in-a-CSV-input-file/m-p/232583#M68997</guid>
      <dc:creator>marina_rovira</dc:creator>
      <dc:date>2016-01-14T16:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a field with a numeric value in a CSV input file to a word equivalent at index-time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-field-with-a-numeric-value-in-a-CSV-input-file/m-p/232584#M68998</link>
      <description>&lt;P&gt;There are a couple of options&lt;/P&gt;

&lt;P&gt;If you must do it at index time, you can use &lt;CODE&gt;SEDCMD&lt;/CODE&gt; in your &lt;CODE&gt;props.con&lt;/CODE&gt; to anonymize your data. See online documentation for more details&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.0/Data/Anonymizedatausingconfigurationfiles"&gt;1&lt;/A&gt;. The limitation with this howeever, is you cannot use &lt;CODE&gt;INDEXED_EXTRACTIONS&lt;/CODE&gt; to extract your csv data. You will have to import them as &lt;CODE&gt;DELIM&lt;/CODE&gt; and specify &lt;CODE&gt;FIELD&lt;/CODE&gt; names in your transforms.&lt;/P&gt;

&lt;P&gt;The other option, would be to create a &lt;CODE&gt;calculated&lt;/CODE&gt; field. This will add a new field that can be used in your searches. Read up on that here &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1/Knowledge/definecalcfields"&gt;http://docs.splunk.com/Documentation/Splunk/6.1/Knowledge/definecalcfields&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2016 18:12:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-field-with-a-numeric-value-in-a-CSV-input-file/m-p/232584#M68998</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-01-14T18:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to change a field with a numeric value in a CSV input file to a word equivalent at index-time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-field-with-a-numeric-value-in-a-CSV-input-file/m-p/232585#M68999</link>
      <description>&lt;P&gt;OK thanks.  Right now I'm trying to create an automatic lookup to use at search time.   But I'll try the calculated field method.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2016 18:38:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-a-field-with-a-numeric-value-in-a-CSV-input-file/m-p/232585#M68999</guid>
      <dc:creator>corosco112</dc:creator>
      <dc:date>2016-01-14T18:38:50Z</dc:date>
    </item>
  </channel>
</rss>

