<?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 Enum for non numerical values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Enum-for-non-numerical-values/m-p/560765#M159381</link>
    <description>&lt;P&gt;I have a non numerical field (text), and I want to create an enum field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Meaning that I will have a new field with numerical values that match the text values of the original field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Jul 2021 11:42:06 GMT</pubDate>
    <dc:creator>ndd</dc:creator>
    <dc:date>2021-07-26T11:42:06Z</dc:date>
    <item>
      <title>Enum for non numerical values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Enum-for-non-numerical-values/m-p/560765#M159381</link>
      <description>&lt;P&gt;I have a non numerical field (text), and I want to create an enum field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Meaning that I will have a new field with numerical values that match the text values of the original field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 11:42:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Enum-for-non-numerical-values/m-p/560765#M159381</guid>
      <dc:creator>ndd</dc:creator>
      <dc:date>2021-07-26T11:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Enum for non numerical values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Enum-for-non-numerical-values/m-p/560768#M159382</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/236806"&gt;@ndd&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please explain more with example like sample value of&amp;nbsp;&lt;SPAN&gt;non numerical field and expected&amp;nbsp;results from that field.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;KV&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 11:49:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Enum-for-non-numerical-values/m-p/560768#M159382</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-07-26T11:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: Enum for non numerical values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Enum-for-non-numerical-values/m-p/560769#M159383</link>
      <description>&lt;P&gt;Sure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assume the following table&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;&lt;STRONG&gt;Id&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;&lt;STRONG&gt;Message&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;&lt;STRONG&gt;...&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;1&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;Success&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;2&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;Fail&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;3&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;Error&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;4&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;Success&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to get another field that will automatically assign a number to each message. (This number can be a random number or serial, what is important for me is that the numerical values from the new field correlate to the "message" field.&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="75%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;&lt;STRONG&gt;Id&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;&lt;STRONG&gt;Message&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;&lt;STRONG&gt;(New Field)&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;&lt;STRONG&gt;...&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;1&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;Success&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;1&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;2&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;Fail&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;2&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;3&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;Error&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;3&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;4&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;Success&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;1&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 26 Jul 2021 12:04:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Enum-for-non-numerical-values/m-p/560769#M159383</guid>
      <dc:creator>ndd</dc:creator>
      <dc:date>2021-07-26T12:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Enum for non numerical values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Enum-for-non-numerical-values/m-p/560781#M159386</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/236806"&gt;@ndd&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please try this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YOUR_SEARCH 
| eval anotherField=case(Message="Success",1,Message="Fail",2,Message="Error",3)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Sample Search :&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw="Id	Message	...
1	Success	...
2	Fail	...
3	Error	...
4	Success" | multikv forceheader=1
| table Id	Message | eval anotherField=case(Message="Success",1,Message="Fail",2,Message="Error",3)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;Thanks&lt;BR /&gt;KV&lt;BR /&gt;▄︻̷̿┻̿═━一 &amp;nbsp; ?&lt;BR /&gt;&lt;BR /&gt;If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 12:45:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Enum-for-non-numerical-values/m-p/560781#M159386</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-07-26T12:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Enum for non numerical values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Enum-for-non-numerical-values/m-p/561618#M195364</link>
      <description>&lt;P&gt;Hi KV,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually I am looking to&amp;nbsp;&lt;SPAN&gt;automatically assign the number.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have around 100 values of "message" therefore a "case when" type solution does not work here.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The number that is assigned can be random, what is important is to be able to correlate between logs according to this new number field. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there a solution for this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 01 Aug 2021 10:22:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Enum-for-non-numerical-values/m-p/561618#M195364</guid>
      <dc:creator>ndd</dc:creator>
      <dc:date>2021-08-01T10:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: Enum for non numerical values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Enum-for-non-numerical-values/m-p/561619#M195365</link>
      <description>&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw="Id	Message	...
1	Success	...
2	Fail	...
3	Error	...
4	Success" | multikv forceheader=1
| table Id Message
| eventstats values(Message) as enum_key
| eval enum=mvfind(enum_key,Message)
| table Id Message enum&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 01 Aug 2021 10:33:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Enum-for-non-numerical-values/m-p/561619#M195365</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-08-01T10:33:41Z</dc:date>
    </item>
  </channel>
</rss>

