<?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: How to generate a search for specific words in row data? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231601#M68695</link>
    <description>&lt;P&gt;@jw44250 - did you ever get a solution to this one?&lt;/P&gt;</description>
    <pubDate>Wed, 14 Jun 2017 18:33:37 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-06-14T18:33:37Z</dc:date>
    <item>
      <title>How to generate a search for specific words in row data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231589#M68683</link>
      <description>&lt;P&gt;My search result is like this :&lt;/P&gt;

&lt;P&gt;result 1&lt;BR /&gt;
 .  message hello test helo test &lt;/P&gt;

&lt;P&gt;result 2&lt;BR /&gt;
 .  message hello test helo test &lt;/P&gt;

&lt;P&gt;result3 &lt;BR /&gt;
 .  message hello test helo test &lt;/P&gt;

&lt;P&gt;count or group by message1, message 2&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 20:39:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231589#M68683</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-01-17T20:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for specific words in row data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231590#M68684</link>
      <description>&lt;P&gt;there is no unique field ,&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 20:40:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231590#M68684</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-01-17T20:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for specific words in row data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231591#M68685</link>
      <description>&lt;P&gt;@jw44250 - It would be helpful if you were to provide the search you're already using. Also, the more information you provide in your post, the greater chance of it being answered with a working solution.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 21:03:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231591#M68685</guid>
      <dc:creator>aaraneta_splunk</dc:creator>
      <dc:date>2017-01-17T21:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for specific words in row data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231592#M68686</link>
      <description>&lt;P&gt;Is the message field already extracted? If not, share some sample result so that we can suggest a regex for it to extract. After the fields extraction, you could simply use &lt;CODE&gt;...| stats count by message&lt;/CODE&gt;type of commands.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 21:42:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231592#M68686</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-01-17T21:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for specific words in row data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231593#M68687</link>
      <description>&lt;P&gt;index= index1 "message"&lt;/P&gt;

&lt;P&gt;message can appear anywhere, start of paraph, midd, end,etc&lt;/P&gt;

&lt;P&gt;Query Result&lt;/P&gt;

&lt;P&gt;"message hello1"&lt;/P&gt;

&lt;P&gt;message=" message hello2";&lt;/P&gt;

&lt;P&gt;message="message hello1"&lt;/P&gt;

&lt;P&gt;message="hello message test"&lt;/P&gt;

&lt;P&gt;message="mikale"&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 23:25:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231593#M68687</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-01-17T23:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for specific words in row data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231594#M68688</link>
      <description>&lt;P&gt;actually needed to group them &lt;/P&gt;

&lt;P&gt;"message hello1" &lt;BR /&gt;
message=" message hello2";&lt;BR /&gt;
message="hello message test"&lt;BR /&gt;
message="mikale"&lt;BR /&gt;
there is not unique field.. i want make new field and &lt;BR /&gt;
do something like &lt;/P&gt;

&lt;P&gt;_row="subtring(message) 0-20 characters as meesage&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 23:26:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231594#M68688</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-01-17T23:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for specific words in row data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231595#M68689</link>
      <description>&lt;P&gt;First, you can't create a variable with a name that starts with underscore (_).&lt;BR /&gt;
Here is  a way to group them and report; this answer includes some of the ideas in the comments as well.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index1 "message hello1" OR "message hello2" plus whatever else belongs in your search
| rex "message\s(?&amp;lt;message&amp;gt;.{1,20})"
| eval message=case (isnull(message),"No message",
            match(_raw,"hello1") OR user="admin","Msg 3",
            match(_raw,"hello2"),"Msg 2",
            match(_raw,"hello1"),"Msg 1" )
| stats count by message
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;First, the rex command looks at the raw text for the word "message" followed by a space, and then collects the following 20 characters (or less if there aren't 20 characters remaining on the line).&lt;BR /&gt;
Next, the eval command checks for a number of conditions: is the message field null (meaning that there was no match in the rex command), does it match one of several patterns? Notice that the tests are executed in order, and the first true condition determines the new value of message. If none of the conditions are true, the value of message is unchanged. This gives you the ability to further categorize the data if you wish. If not, you can leave out the entire eval command.&lt;BR /&gt;
Finally, the stats command counts the number of occurrences of each message.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 00:21:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231595#M68689</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2017-01-18T00:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for specific words in row data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231596#M68690</link>
      <description>&lt;P&gt;assuming in your results "result_field" starts with word message and ends with last word of the message. I have assumed that your result field can start with &lt;BR /&gt;
message ...&lt;BR /&gt;
message= ...&lt;BR /&gt;
message = ... etc&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Blockquote&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;PRE&gt;&lt;CODE&gt; your search ...   | rex field=result_field "message\s*\=*\s*(?&amp;lt;Msg&amp;gt;.*)$" | stats count by Msg
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Blockquote&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 18 Jan 2017 01:10:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231596#M68690</guid>
      <dc:creator>nabeel652</dc:creator>
      <dc:date>2017-01-18T01:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for specific words in row data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231597#M68691</link>
      <description>&lt;P&gt;The message can appear any place ...these statements comes from logs files&lt;BR /&gt;
Suppose you have statements like:&lt;/P&gt;

&lt;P&gt;Result 1&lt;BR /&gt;
"This message from john."&lt;/P&gt;

&lt;P&gt;Result 2 &lt;BR /&gt;
"Message sorry boss not wrong data"&lt;/P&gt;

&lt;P&gt;Result &lt;BR /&gt;
"Pls correct your message before going forward"&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 02:26:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231597#M68691</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-01-18T02:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for specific words in row data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231598#M68692</link>
      <description>&lt;P&gt;Result 4&lt;BR /&gt;
"This message from john."&lt;/P&gt;

&lt;P&gt;Result 5 &lt;BR /&gt;
"Message sorry boss not wrong data"&lt;/P&gt;

&lt;P&gt;Result  5&lt;BR /&gt;
"Pls correct your message before going forward"&lt;/P&gt;

&lt;P&gt;Group Message A =&amp;gt; 1 and 4 = "This message from john"&lt;BR /&gt;
Group Message B =&amp;gt; 2 &amp;amp; 5 " = "Message sorry boss not data"&lt;BR /&gt;
Group Message C = 3 &amp;amp; 6 result "pls correct your message before going forward"&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 02:29:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231598#M68692</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-01-18T02:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for specific words in row data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231599#M68693</link>
      <description>&lt;P&gt;where you are getting this data "field=result_field" ... it will not work since i dont have any field or unique anything...its just a stamement like "This message from john"&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 03:07:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231599#M68693</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-01-18T03:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for specific words in row data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231600#M68694</link>
      <description>&lt;P&gt;This question is extremely vague and not well-formed.  It's not possible to give you code to solve your issue if the structure of the data isn't understood accurately.  &lt;/P&gt;

&lt;P&gt;1) Is there a field that is the one that contains the word message, or are we checking the _raw event data?&lt;/P&gt;

&lt;P&gt;2) If the details of the message location can vary widely, please explain in English how exactly YOU (as a human) would determine that two messages inside the _raw data were exactly the same?  What would you use as the boundaries of the "message" part of the _raw data?&lt;/P&gt;

&lt;P&gt;3) If the value of the whole message is to be extracted from _raw data, then please show us two entire messages -- different but similar -- with all the timestamps and other field markers present.  You can obfuscate the data as needed -- replace the hostnames with "myhost", usernames with "myusername"  etc.  Once we see this, we can code you a regular expression to pull out the message data.&lt;/P&gt;

&lt;P&gt;As a general case, I'm assuming that we are aiming for something like this -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex [your original search] | search "message" 
| rex field=_raw "some regular expression that pulls out (?&amp;lt;TheMessage&amp;gt;.*) and leaves out stuff that isn't the message..."
| stats count by TheMessage
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Jan 2017 15:45:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231600#M68694</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-01-18T15:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for specific words in row data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231601#M68695</link>
      <description>&lt;P&gt;@jw44250 - did you ever get a solution to this one?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2017 18:33:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231601#M68695</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-06-14T18:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate a search for specific words in row data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231602#M68696</link>
      <description>&lt;P&gt;Yes..thanks from everyone...sorry been busy with work..&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 00:53:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-a-search-for-specific-words-in-row-data/m-p/231602#M68696</guid>
      <dc:creator>jw44250</dc:creator>
      <dc:date>2017-06-16T00:53:04Z</dc:date>
    </item>
  </channel>
</rss>

