<?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 can I search for specific text within _raw? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-for-specific-text-within-raw/m-p/248008#M73993</link>
    <description>&lt;P&gt;Hi SplunkLunk!&lt;/P&gt;

&lt;P&gt;When searching over events to match strings contained within them, there is no need to explicitly tell Splunk to check the _raw message, as it will be doing that by default.&lt;/P&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=n00blab host=n00bserver sourcetype=linux:ubuntu:auth root
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This search tells Splunk to bring us back any events that have the explicit fields we asked for AND (any space in your search is treated as an implicit 'AND') contains the literal string "root", anywhere in it. &lt;/P&gt;

&lt;P&gt;It is the same as saying:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=n00blab host=n00bserver sourcetype=linux:ubuntu:auth _raw=*root*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The tricky part when searching _raw= is to remember that if you simply said _raw=root, nothing would match, cause I don't have any raw events that only contain the word 'root'. However, I have plenty of events that CONTAIN the string root, so by adding the asterisks, I turn it into a CONTAINS rather than EQUALS...&lt;/P&gt;

&lt;P&gt;I strongly recommend bookmarking the Splunk search reference manual, as even the most seasoned Splunker needs to consult the docs for search syntax and rules, from time to time! &lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/WhatsInThisManual"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/WhatsInThisManual&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Nov 2016 14:01:57 GMT</pubDate>
    <dc:creator>mattymo</dc:creator>
    <dc:date>2016-11-28T14:01:57Z</dc:date>
    <item>
      <title>How can I search for specific text within _raw?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-for-specific-text-within-raw/m-p/248007#M73992</link>
      <description>&lt;P&gt;Good morning,&lt;/P&gt;

&lt;P&gt;I want to search for specific text within the &lt;CODE&gt;_raw&lt;/CODE&gt; output of my syslog messages.  Something along the lines of where &lt;CODE&gt;_raw=*example*&lt;/CODE&gt;.  So now I have &lt;CODE&gt;index=myindex host=myhost source=/var/log/messages&lt;/CODE&gt; and then I want to only select certain events based on what is in &lt;CODE&gt;_raw&lt;/CODE&gt;.  What is the correct syntax for that?  Eventually I may try to extract new fields using Splunk but for now I want to make sure I can search for certain events.  Thanks for any help you can provide.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 13:35:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-for-specific-text-within-raw/m-p/248007#M73992</guid>
      <dc:creator>SplunkLunk</dc:creator>
      <dc:date>2016-11-28T13:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: How can I search for specific text within _raw?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-for-specific-text-within-raw/m-p/248008#M73993</link>
      <description>&lt;P&gt;Hi SplunkLunk!&lt;/P&gt;

&lt;P&gt;When searching over events to match strings contained within them, there is no need to explicitly tell Splunk to check the _raw message, as it will be doing that by default.&lt;/P&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=n00blab host=n00bserver sourcetype=linux:ubuntu:auth root
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This search tells Splunk to bring us back any events that have the explicit fields we asked for AND (any space in your search is treated as an implicit 'AND') contains the literal string "root", anywhere in it. &lt;/P&gt;

&lt;P&gt;It is the same as saying:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=n00blab host=n00bserver sourcetype=linux:ubuntu:auth _raw=*root*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The tricky part when searching _raw= is to remember that if you simply said _raw=root, nothing would match, cause I don't have any raw events that only contain the word 'root'. However, I have plenty of events that CONTAIN the string root, so by adding the asterisks, I turn it into a CONTAINS rather than EQUALS...&lt;/P&gt;

&lt;P&gt;I strongly recommend bookmarking the Splunk search reference manual, as even the most seasoned Splunker needs to consult the docs for search syntax and rules, from time to time! &lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/WhatsInThisManual"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/WhatsInThisManual&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 14:01:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-for-specific-text-within-raw/m-p/248008#M73993</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2016-11-28T14:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: How can I search for specific text within _raw?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-for-specific-text-within-raw/m-p/248009#M73994</link>
      <description>&lt;P&gt;mmodestino,&lt;/P&gt;

&lt;P&gt;Thanks!  So if I understand correctly if my search was index=[myindex] host=[myhost] source=/var/log/messages PHP Warning it will pull any events showing "PHP Warning" in _raw since I know that's where it's sitting?  I tried it out and it seems to be what I'm looking for.  Much appreciated. &lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 14:14:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-for-specific-text-within-raw/m-p/248009#M73994</guid>
      <dc:creator>SplunkLunk</dc:creator>
      <dc:date>2016-11-28T14:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can I search for specific text within _raw?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-for-specific-text-within-raw/m-p/248010#M73995</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=[myindex] host=[myhost] source=/var/log/messages PHP Warning
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;would search for events with PHP AND Warning in it.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=[myindex] host=[myhost] source=/var/log/messages "PHP Warning"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;would search for the literal string "PHP Warning"&lt;/P&gt;

&lt;P&gt;BONUS:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=[myindex] host=[myhost] source=/var/log/messages PHP OR Warning
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;would search for events with PHP OR Warning string in it. &lt;/P&gt;

&lt;P&gt;FYI, you can  use the comment function when discussing questions further, rather than posting an answer. You can convert your answer to a comment with the gear symbol on your answer!&lt;/P&gt;

&lt;P&gt;Also, don't forget to accept the answers you get if they help!&lt;/P&gt;

&lt;P&gt;Happy Splunking!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 15:55:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-search-for-specific-text-within-raw/m-p/248010#M73995</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2016-11-28T15:55:17Z</dc:date>
    </item>
  </channel>
</rss>

