<?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 send a partial string value to a lookup table and count the occurrences? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-send-a-partial-string-value-to-a-lookup-table-and-count/m-p/222912#M65565</link>
    <description>&lt;P&gt;I have a field that contains a sentence such as "I love wonderful food!" I want to be able to check each word against a lookup table to determine if the sentence was positive or negative. I need to be able to track the count of each good and bad word and give the sentence a score. So for the above sentence the score would be +2. &lt;/P&gt;

&lt;P&gt;Lookup Table&lt;BR /&gt;
Good         | Bad&lt;BR /&gt;
love           |  hate&lt;BR /&gt;
wonderful| &lt;/P&gt;

&lt;P&gt;Is this possible with a lookup table or would it potentially be easier to turn the entire event into raw text and search against a multi valued field?&lt;/P&gt;</description>
    <pubDate>Fri, 11 Sep 2015 21:26:51 GMT</pubDate>
    <dc:creator>LWilliamson1</dc:creator>
    <dc:date>2015-09-11T21:26:51Z</dc:date>
    <item>
      <title>How to send a partial string value to a lookup table and count the occurrences?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-send-a-partial-string-value-to-a-lookup-table-and-count/m-p/222912#M65565</link>
      <description>&lt;P&gt;I have a field that contains a sentence such as "I love wonderful food!" I want to be able to check each word against a lookup table to determine if the sentence was positive or negative. I need to be able to track the count of each good and bad word and give the sentence a score. So for the above sentence the score would be +2. &lt;/P&gt;

&lt;P&gt;Lookup Table&lt;BR /&gt;
Good         | Bad&lt;BR /&gt;
love           |  hate&lt;BR /&gt;
wonderful| &lt;/P&gt;

&lt;P&gt;Is this possible with a lookup table or would it potentially be easier to turn the entire event into raw text and search against a multi valued field?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2015 21:26:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-send-a-partial-string-value-to-a-lookup-table-and-count/m-p/222912#M65565</guid>
      <dc:creator>LWilliamson1</dc:creator>
      <dc:date>2015-09-11T21:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to send a partial string value to a lookup table and count the occurrences?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-send-a-partial-string-value-to-a-lookup-table-and-count/m-p/222913#M65566</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Maybe try something like this:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;sourcetype=word_parse | eval clean_sentence = replace(sentence, , ""&amp;gt; | eval parsed_sentence = split(clean_sentence, " ") | mvexpand parsed_sentence | lookup point_lookup word as parsed_sentence OUTPUT score | stats sum(score) as total&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;You might want to try a lookup table like this:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Lookup point_lookup:&lt;BR /&gt;
word | score&lt;BR /&gt;
Good | 1&lt;BR /&gt;
Bad | -1&lt;BR /&gt;
love | 1&lt;BR /&gt;
hate | -1&lt;BR /&gt;
wonderful| 1&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:15:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-send-a-partial-string-value-to-a-lookup-table-and-count/m-p/222913#M65566</guid>
      <dc:creator>jaredlaney</dc:creator>
      <dc:date>2020-09-29T07:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to send a partial string value to a lookup table and count the occurrences?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-send-a-partial-string-value-to-a-lookup-table-and-count/m-p/222914#M65567</link>
      <description>&lt;P&gt;Edit: I think it's something in the back end throwing an error for this particular search.&lt;/P&gt;

&lt;P&gt;I like your idea but for some reason it's giving no output. I changed your search to:&lt;/P&gt;

&lt;P&gt;... |eval clean_sentence = replace(sentence,' ',"") | eval parsed_sentence = split(clean_sentence, " ") | mvexpand parsed_sentence | lookup point_lookup word as parsed_sentence OUTPUT score | stats sum(score) as total &lt;/P&gt;

&lt;P&gt;but it appears to generate no output/matches. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:15:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-send-a-partial-string-value-to-a-lookup-table-and-count/m-p/222914#M65567</guid>
      <dc:creator>LWilliamson1</dc:creator>
      <dc:date>2020-09-29T07:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to send a partial string value to a lookup table and count the occurrences?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-send-a-partial-string-value-to-a-lookup-table-and-count/m-p/222915#M65568</link>
      <description>&lt;P&gt;Can you tell me what lookup you used and what the input sentence is?&lt;/P&gt;</description>
      <pubDate>Sun, 13 Sep 2015 06:10:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-send-a-partial-string-value-to-a-lookup-table-and-count/m-p/222915#M65568</guid>
      <dc:creator>jaredlaney</dc:creator>
      <dc:date>2015-09-13T06:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to send a partial string value to a lookup table and count the occurrences?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-send-a-partial-string-value-to-a-lookup-table-and-count/m-p/222916#M65569</link>
      <description>&lt;P&gt;I recreated my lookup in the same manner as you did and named it point_lookup. The input sentence could be anything from "I love my iphone" to "I hate my iphone". The input is actually twitter data.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2015 02:23:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-send-a-partial-string-value-to-a-lookup-table-and-count/m-p/222916#M65569</guid>
      <dc:creator>LWilliamson1</dc:creator>
      <dc:date>2015-09-14T02:23:35Z</dc:date>
    </item>
  </channel>
</rss>

