<?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: User agent string using lookup table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/User-agent-string-using-lookup-table/m-p/550811#M156306</link>
    <description>&lt;P&gt;The case function will return null if none of the expressions are true.&amp;nbsp; That's why it's a good practice to include as the last expression something that will always evaluate to true (similar to the 'default' case in HLLs).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=aws Website="*"
| eval test = case(match(useragent,"Windows .. 5\.1"),"Windows XP",match(useragent,"droid"),"Android",match(useragent,"Windows NT 6\.1"),"Windows 7", 1==1, "Unknown")&lt;/LI-CODE&gt;&lt;P&gt;If the field is set to the default value then you know none of the other cases matched and you need to re-evaluate your code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 May 2021 12:50:49 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2021-05-07T12:50:49Z</dc:date>
    <item>
      <title>User agent string using lookup table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/User-agent-string-using-lookup-table/m-p/550744#M156284</link>
      <description>&lt;P&gt;Hi Team&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to extract the OS details from the user agent using the below eval command, however I am not able to see new filed was created (test) after i executed the spl query&lt;/P&gt;&lt;P&gt;index=aws Website="*"&lt;BR /&gt;| eval &lt;STRONG&gt;&lt;FONT color="#333333"&gt;test &lt;/FONT&gt;&lt;/STRONG&gt;= case(match(useragent,"Windows .. 5\.1"),"Windows XP",match(useragent,"droid"),"Android",match(useragent,"Windows NT 6.1"),"Windows 7")&lt;/P&gt;&lt;P&gt;Any help please&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank s&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 01:55:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/User-agent-string-using-lookup-table/m-p/550744#M156284</guid>
      <dc:creator>jaibalaraman</dc:creator>
      <dc:date>2021-05-07T01:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: User agent string using lookup table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/User-agent-string-using-lookup-table/m-p/550811#M156306</link>
      <description>&lt;P&gt;The case function will return null if none of the expressions are true.&amp;nbsp; That's why it's a good practice to include as the last expression something that will always evaluate to true (similar to the 'default' case in HLLs).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=aws Website="*"
| eval test = case(match(useragent,"Windows .. 5\.1"),"Windows XP",match(useragent,"droid"),"Android",match(useragent,"Windows NT 6\.1"),"Windows 7", 1==1, "Unknown")&lt;/LI-CODE&gt;&lt;P&gt;If the field is set to the default value then you know none of the other cases matched and you need to re-evaluate your code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 12:50:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/User-agent-string-using-lookup-table/m-p/550811#M156306</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-05-07T12:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: User agent string using lookup table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/User-agent-string-using-lookup-table/m-p/551157#M156396</link>
      <description>&lt;P&gt;Hi richgalloway&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your message&lt;/P&gt;&lt;P&gt;Yes, i tried executing's the SPL command found no error however i am not getting any statistics result&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jaibalaraman_0-1620706992534.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14108i673716E4527302AF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jaibalaraman_0-1620706992534.png" alt="jaibalaraman_0-1620706992534.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 04:23:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/User-agent-string-using-lookup-table/m-p/551157#M156396</guid>
      <dc:creator>jaibalaraman</dc:creator>
      <dc:date>2021-05-11T04:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: User agent string using lookup table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/User-agent-string-using-lookup-table/m-p/551234#M156420</link>
      <description>&lt;P&gt;The query you ran does not have a command that generates statistics so you won't see anything in the Statistics tab.&amp;nbsp; Look at the results in the Events tab or add commands to the given query.&amp;nbsp; It was not meant to be complete - just to answer the question asked.&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 12:44:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/User-agent-string-using-lookup-table/m-p/551234#M156420</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-05-11T12:44:46Z</dc:date>
    </item>
  </channel>
</rss>

