<?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: extract field using rex without using _raw in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/extract-field-using-rex-without-using-raw/m-p/505530#M141276</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;_raw is the default field for rex. You can use the rex command without specifying the field if you are targetting your raw data (e.g. like you are doing). If you want to rex from a table (e.g. stats result) you need to specify the field.&lt;/P&gt;&lt;P&gt;You can always set up a field extraction in props.conf for your sourcetype. This way you don't need to use rex on your search.&lt;/P&gt;&lt;P&gt;What I don't understand is what you mean with an error thrown with the commit to Github. Do you run Splunk app inspect as some sort of workflow action on commit and that's throwing the errors? If that's the case can you post your search stanza ("&lt;SPAN&gt;[ABC&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;Error alert]&lt;/SPAN&gt;") from searches.conf?&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Mon, 22 Jun 2020 16:12:03 GMT</pubDate>
    <dc:creator>diogofgm</dc:creator>
    <dc:date>2020-06-22T16:12:03Z</dc:date>
    <item>
      <title>extract field using rex without using _raw</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extract-field-using-rex-without-using-raw/m-p/505521#M141273</link>
      <description>&lt;P&gt;I have data like&lt;/P&gt;&lt;P&gt;202-06-19T13:02:293 message="event(level=Error name=xyz)&lt;/P&gt;&lt;P&gt;&amp;nbsp;context: {&lt;/P&gt;&lt;P&gt;Id: 12345,&lt;/P&gt;&lt;P&gt;locale: 'us'&lt;/P&gt;&lt;P&gt;blah blah&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My objective is to get error count by corresponding to Id . I have a csv say abc.csv from which I have to look up Id and display result only corresponding to the Id present in csv. moreover for some logs id is logged as field but for some it is not getting logged as field. I used below query:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=rxc sourcetype="rxcapp"  (level=ERROR) earliest=-30m | rex field=_raw "Id:[\S\s]+?(?&amp;lt;Id&amp;gt;.\d+)" | search  [| inputlookup abc.csv | rename id as Id | fields Id]| lookup abc.csv id As Id OUTPUT site| stats count by name site level&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is giving me result correctly when I search but when I go and commit it on github it throws error like below :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;REX FIELD checks for use of _raw &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FAILURE: in file local/searches.conf in section [ABC&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;Error alert] -&amp;gt; rex field cannot = _raw&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way I can achieve what I want without using _raw and&amp;nbsp; "context" is also not logged as field in logs(fyi)&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 14:53:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extract-field-using-rex-without-using-raw/m-p/505521#M141273</guid>
      <dc:creator>ksharma7</dc:creator>
      <dc:date>2020-06-22T14:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: extract field using rex without using _raw</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extract-field-using-rex-without-using-raw/m-p/505530#M141276</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;_raw is the default field for rex. You can use the rex command without specifying the field if you are targetting your raw data (e.g. like you are doing). If you want to rex from a table (e.g. stats result) you need to specify the field.&lt;/P&gt;&lt;P&gt;You can always set up a field extraction in props.conf for your sourcetype. This way you don't need to use rex on your search.&lt;/P&gt;&lt;P&gt;What I don't understand is what you mean with an error thrown with the commit to Github. Do you run Splunk app inspect as some sort of workflow action on commit and that's throwing the errors? If that's the case can you post your search stanza ("&lt;SPAN&gt;[ABC&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;Error alert]&lt;/SPAN&gt;") from searches.conf?&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 16:12:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extract-field-using-rex-without-using-raw/m-p/505530#M141276</guid>
      <dc:creator>diogofgm</dc:creator>
      <dc:date>2020-06-22T16:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: extract field using rex without using _raw</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extract-field-using-rex-without-using-raw/m-p/505647#M141361</link>
      <description>&lt;P&gt;Got it by just removing filed and _raw&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;|rex "Id:\s*(?&amp;lt;Id&amp;gt;\d+),"&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 05:13:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extract-field-using-rex-without-using-raw/m-p/505647#M141361</guid>
      <dc:creator>ksharma7</dc:creator>
      <dc:date>2020-06-23T05:13:58Z</dc:date>
    </item>
  </channel>
</rss>

