<?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 keyword Lookup and Replace in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/User-keyword-Lookup-and-Replace/m-p/105747#M27452</link>
    <description>&lt;P&gt;And you could also send a message to the author of the plug-in. I am sure he would answer...&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jul 2013 18:54:53 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2013-07-24T18:54:53Z</dc:date>
    <item>
      <title>User keyword Lookup and Replace</title>
      <link>https://community.splunk.com/t5/Splunk-Search/User-keyword-Lookup-and-Replace/m-p/105743#M27448</link>
      <description>&lt;P&gt;I'm trying to use lookups to do a keyword search and I can't grasp my brain around the right way to do this.&lt;/P&gt;

&lt;P&gt;I've got some web logs I'm looking at in splunk that contain data that identifies what operating system and browser a user is using.  The string that contains this data isn't always the same algorithm so my regex's haven't been succssful.   I'm planning on making a chart of the most popular browsers and the most popular operating systems.  I'd like to do the following as a new idea:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt; Make a csv of all the operating systems and a csv of all the browsers.&lt;/LI&gt;
&lt;LI&gt; Use the lookups command to do a keyword search to locate these key words and rename them to more identifiable terms (example:  Windows NT 6.1 = Windows 7).&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt; Perform a count of how many times the new identifiable term (example:  Windows 7) has been found for the given period of time.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;I have a simple search like this.  I am looking at one particular object to get the information I need:&lt;/P&gt;

&lt;P&gt;sourcetype=access_logs command=GET company_logo | dedup username&lt;/P&gt;

&lt;P&gt;The type of information i get back in results is :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;10.10.10.10 10.120.130.140 www.testing.somedomain.com [22/Jul/2013:19:22:08 +0000] 304 "GET /blahblah-tmf/images/company_logo.png HTTP/1.1" [booberry] (http-apr-8080-exec-3) 1 - "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So, I want to pipe this search to look at the lookup file, look for keywords I have listed, rename those keywords to something else and put them in a field, and then I will do a count of how many times those new renamed keywords were found.  Even if I don't use the lookups command and somehow could do an automatic lookup would be cool.  &lt;/P&gt;

&lt;P&gt;My lookup file for the browser csv I started looked like:&lt;/P&gt;

&lt;P&gt;keyword, browser_type&lt;BR /&gt;
Trident/4.0,IE8&lt;BR /&gt;
Trident/5.0,IE9&lt;BR /&gt;
Trident/6.0,IE10&lt;/P&gt;

&lt;P&gt;I checked a few other questions on this but didn't get it right just yet so figured I'd dump that here.  I tried this one:  &lt;A href="http://splunk-base.splunk.com/answers/84799/find-multiple-keywords-in-file-and-show-them-on-a-chart" target="_blank"&gt;http://splunk-base.splunk.com/answers/84799/find-multiple-keywords-in-file-and-show-them-on-a-chart&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;My search is this so far:&lt;BR /&gt;
sourcetype=access_logs command=GET company_logo | dedup username&lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:25:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/User-keyword-Lookup-and-Replace/m-p/105743#M27448</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2020-09-28T14:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: User keyword Lookup and Replace</title>
      <link>https://community.splunk.com/t5/Splunk-Search/User-keyword-Lookup-and-Replace/m-p/105744#M27449</link>
      <description>&lt;P&gt;Before you go too far down this path, you might look at this question/answer about&lt;BR /&gt;
&lt;A href="http://splunk-base.splunk.com/answers/93140/iis-cs_user_agent-extraction"&gt;IIS User Agent Extraction&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;There is no definitive list of possible user-agents, and no algorithm for deriving the OS and browser from the user agent. But the technology add-ons that are mentioned in &lt;A href="http://splunk-base.splunk.com/answers/93140/iis-cs_user_agent-extraction"&gt;IIS User Agent Extraction&lt;/A&gt; question are pretty good.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2013 17:43:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/User-keyword-Lookup-and-Replace/m-p/105744#M27449</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-07-24T17:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: User keyword Lookup and Replace</title>
      <link>https://community.splunk.com/t5/Splunk-Search/User-keyword-Lookup-and-Replace/m-p/105745#M27450</link>
      <description>&lt;P&gt;Well the one plugin expects a field http_user_agent which I don't have.  I tried maybe changing the script to look at a different field but so far no dice.  It's a cool plugin though.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:25:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/User-keyword-Lookup-and-Replace/m-p/105745#M27450</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2020-09-28T14:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: User keyword Lookup and Replace</title>
      <link>https://community.splunk.com/t5/Splunk-Search/User-keyword-Lookup-and-Replace/m-p/105746#M27451</link>
      <description>&lt;P&gt;If you were using the sourcetype of &lt;CODE&gt;access_combined&lt;/CODE&gt; or &lt;CODE&gt;access_combined_wcookie&lt;/CODE&gt; (which are built into Splunk), you would have a field named &lt;CODE&gt;useragent&lt;/CODE&gt;. You could set a field alias of &lt;CODE&gt;http_user_agent&lt;/CODE&gt; and that would solve the problem.&lt;/P&gt;

&lt;P&gt;For your sourcetype, I don't know what field you have, but it should include the entire string&lt;BR /&gt;
&lt;CODE&gt;"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Again, setting a field alias would create the field name that the script expects. That would be easier than changing the script.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2013 18:53:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/User-keyword-Lookup-and-Replace/m-p/105746#M27451</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-07-24T18:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: User keyword Lookup and Replace</title>
      <link>https://community.splunk.com/t5/Splunk-Search/User-keyword-Lookup-and-Replace/m-p/105747#M27452</link>
      <description>&lt;P&gt;And you could also send a message to the author of the plug-in. I am sure he would answer...&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2013 18:54:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/User-keyword-Lookup-and-Replace/m-p/105747#M27452</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-07-24T18:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: User keyword Lookup and Replace</title>
      <link>https://community.splunk.com/t5/Splunk-Search/User-keyword-Lookup-and-Replace/m-p/105748#M27453</link>
      <description>&lt;P&gt;Well the search I was using originally was sourcetype=access_logs command=GET company_logo | dedup username.  I was trying to only get one count of the browser and OS a user was using when they login to the web app.  I'm going to keep playing around with this a bit though.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:25:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/User-keyword-Lookup-and-Replace/m-p/105748#M27453</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2020-09-28T14:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: User keyword Lookup and Replace</title>
      <link>https://community.splunk.com/t5/Splunk-Search/User-keyword-Lookup-and-Replace/m-p/105749#M27454</link>
      <description>&lt;P&gt;oh wait are you saying i should make a field out of the entire string "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0" that i might find in the logs and then push that to the lookup file?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2013 19:07:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/User-keyword-Lookup-and-Replace/m-p/105749#M27454</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2013-07-24T19:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: User keyword Lookup and Replace</title>
      <link>https://community.splunk.com/t5/Splunk-Search/User-keyword-Lookup-and-Replace/m-p/105750#M27455</link>
      <description>&lt;P&gt;Yes, I think that will work...&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2013 18:15:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/User-keyword-Lookup-and-Replace/m-p/105750#M27455</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-07-26T18:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: User keyword Lookup and Replace</title>
      <link>https://community.splunk.com/t5/Splunk-Search/User-keyword-Lookup-and-Replace/m-p/105751#M27456</link>
      <description>&lt;P&gt;Well the field extractor is not letting me extract that information into a field so I guess I have to do this manually.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2013 16:44:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/User-keyword-Lookup-and-Replace/m-p/105751#M27456</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2013-07-29T16:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: User keyword Lookup and Replace</title>
      <link>https://community.splunk.com/t5/Splunk-Search/User-keyword-Lookup-and-Replace/m-p/105752#M27457</link>
      <description>&lt;P&gt;Ok i got this to work actually by extracting the entire line "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0", placing this into a field called "http_user_access" and downloading the necessary csv file for the app.  (view read me).  this worked.  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;  thanks for the tips!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:27:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/User-keyword-Lookup-and-Replace/m-p/105752#M27457</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2020-09-28T14:27:10Z</dc:date>
    </item>
  </channel>
</rss>

