<?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: After transaction: &amp;quot;Field '_raw' does not exist in the data&amp;quot; in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/After-transaction-quot-Field-raw-does-not-exist-in-the-data-quot/m-p/54426#M13298</link>
    <description>&lt;P&gt;Suddenly realized this morning that the problem was the \n delimiter; changing it to a different character helped break up events from _raw. Kind of embarrassing.&lt;/P&gt;

&lt;P&gt;Thanks again Lowell for helping me out!&lt;/P&gt;</description>
    <pubDate>Mon, 08 Aug 2011 17:08:38 GMT</pubDate>
    <dc:creator>acdevlin</dc:creator>
    <dc:date>2011-08-08T17:08:38Z</dc:date>
    <item>
      <title>After transaction: "Field '_raw' does not exist in the data"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/After-transaction-quot-Field-raw-does-not-exist-in-the-data-quot/m-p/54423#M13295</link>
      <description>&lt;P&gt;I'm using a transaction to group events within 30 minutes of one another. What I want to do after that is "undo" one of the large events created by the transaction command, so I can then view the data in more detail.&lt;/P&gt;

&lt;P&gt;With some searching, I found &lt;A href="http://splunk-base.splunk.com/answers/12939/how-to-split-a-transaction"&gt;this thread, which talks about how to split a transaction.&lt;/A&gt; Unfortunately, this method is not working for me; when I try nick's suggested approach, I get the error "Field '_raw' does not exist in the data" and the transaction event is not split up.&lt;/P&gt;

&lt;P&gt;The full search is long and complicated. The section relevant to my question looks something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | transaction user maxpause=30m mvlist=t maxevents=-1 | search start_time="06/15/2011 17:21:52"| eval _raw = split(_raw, "\n") | mvexpand _raw | stats values(req_time)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any ideas? Am I using the _raw field incorrectly?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2011 21:39:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/After-transaction-quot-Field-raw-does-not-exist-in-the-data-quot/m-p/54423#M13295</guid>
      <dc:creator>acdevlin</dc:creator>
      <dc:date>2011-08-05T21:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: After transaction: "Field '_raw' does not exist in the data"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/After-transaction-quot-Field-raw-does-not-exist-in-the-data-quot/m-p/54424#M13296</link>
      <description>&lt;P&gt;Your "_raw" field wouldn't exist anymore after your &lt;CODE&gt;| stats values(req_time)&lt;/CODE&gt;.  Not sure if that's relevant to your entire search or not.&lt;/P&gt;

&lt;P&gt;Have you tried using a field name other than &lt;CODE&gt;_raw&lt;/CODE&gt; (since it has a special purpose) while debugging your search?  Sometimes renaming the field and then naming it back lets you get around some internal assumptions built in to some of the search commands.&lt;/P&gt;

&lt;P&gt;For example, you could try:&lt;/P&gt;

&lt;P&gt;... | eval raw=split(_raw, "\n") | mvexpand raw | rename raw as _raw | ...&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:47:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/After-transaction-quot-Field-raw-does-not-exist-in-the-data-quot/m-p/54424#M13296</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2020-09-28T09:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: After transaction: "Field '_raw' does not exist in the data"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/After-transaction-quot-Field-raw-does-not-exist-in-the-data-quot/m-p/54425#M13297</link>
      <description>&lt;P&gt;Thanks for the speedy reply Lowell. &lt;/P&gt;

&lt;P&gt;Your idea DOES get rid of the error about "_raw"...but it seems the transaction event is not being split up. I still get a single event at the end of the query. Do you have any further suggestions on solving this?&lt;/P&gt;

&lt;P&gt;Also, the "| stats values(req_time)" is what I'm trying to get out of the search as a whole: the specific "req_time" values associated with this particular series of events in the transaction. If that at all makes sense.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:47:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/After-transaction-quot-Field-raw-does-not-exist-in-the-data-quot/m-p/54425#M13297</guid>
      <dc:creator>acdevlin</dc:creator>
      <dc:date>2020-09-28T09:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: After transaction: "Field '_raw' does not exist in the data"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/After-transaction-quot-Field-raw-does-not-exist-in-the-data-quot/m-p/54426#M13298</link>
      <description>&lt;P&gt;Suddenly realized this morning that the problem was the \n delimiter; changing it to a different character helped break up events from _raw. Kind of embarrassing.&lt;/P&gt;

&lt;P&gt;Thanks again Lowell for helping me out!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2011 17:08:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/After-transaction-quot-Field-raw-does-not-exist-in-the-data-quot/m-p/54426#M13298</guid>
      <dc:creator>acdevlin</dc:creator>
      <dc:date>2011-08-08T17:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: After transaction: "Field '_raw' does not exist in the data"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/After-transaction-quot-Field-raw-does-not-exist-in-the-data-quot/m-p/54427#M13299</link>
      <description>&lt;P&gt;@acdevlin,&lt;/P&gt;

&lt;P&gt;I'm trying the same here (to split a transaction back to original events after filtering on transaction) and I hit the same snag 'split(_raw, "\n")' isn't splitting... Could you please tell which character worked for you?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2011 04:43:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/After-transaction-quot-Field-raw-does-not-exist-in-the-data-quot/m-p/54427#M13299</guid>
      <dc:creator>Krishna_R</dc:creator>
      <dc:date>2011-10-18T04:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: After transaction: "Field '_raw' does not exist in the data"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/After-transaction-quot-Field-raw-does-not-exist-in-the-data-quot/m-p/54428#M13300</link>
      <description>&lt;P&gt;Here's an alternative method using &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/rex" target="_blank"&gt;rex&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;For testing purposes let's associate events from metrics.log in clumps of 4 with :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal source=*metrics.log | transaction maxevents=4 source&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This yields transaction meta-events that look like this :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;
12-29-2011 08:51:52.940 -0800 INFO  Metrics - group=queue, name=tcpin_queue, max_size_kb=500, current_size_kb=0, current_size=0, largest_size=0, smallest_size=0
12-29-2011 08:51:52.940 -0800 INFO  Metrics - group=queue, name=typingqueue, max_size_kb=500, current_size_kb=0, current_size=0, largest_size=58, smallest_size=0
12-29-2011 08:51:52.940 -0800 INFO  Metrics - group=realtime_search_data, system total, drop_count=0
12-29-2011 08:51:52.940 -0800 INFO  Metrics - group=search_concurrency, system total, active_hist_searches=0, active_realtime_searches=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To get the original &lt;CODE&gt;_raw&lt;/CODE&gt; field back (and therefore, display the original events) I use rex with a "delimiter" regex matching the date at the beginning of my event, and then all characters until a CLRF. This creates one multi-value field per transaction containing the pre-transaction values of &lt;CODE&gt;_raw&lt;/CODE&gt;, which we can then expand back to a single-value field with &lt;CODE&gt;mvexpand&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal source=*metrics.log | transaction maxevents=4 source | eval transaction_raw=_raw | rex max_match=1000 "(?msi)^(?&lt;RAW&gt;[01]\d-[0-3]\d-2011\s[^\r\n]*?)$" | mvexpand raw | eval _raw=raw&lt;/RAW&gt;&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Remarks :&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;For the delimiter regex to work, you need to specify &lt;CODE&gt;max_match&lt;/CODE&gt; with a value equal to or higher than the maximum number of events you expect in your transaction.&lt;/LI&gt;
&lt;LI&gt;The regex will need to be reworked if your original events span multiple lines.&lt;/LI&gt;
&lt;LI&gt;A transition field (here &lt;CODE&gt;raw&lt;/CODE&gt;) is necessary. You cannot restore &lt;CODE&gt;_raw&lt;/CODE&gt; directly unto itself.&lt;/LI&gt;
&lt;LI&gt;We conserved the transaction's own &lt;CODE&gt;_raw&lt;/CODE&gt; in &lt;CODE&gt;transaction_raw&lt;/CODE&gt; which allows to still report on the transaction results. The transaction special fields are also conserved.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Mon, 28 Sep 2020 10:15:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/After-transaction-quot-Field-raw-does-not-exist-in-the-data-quot/m-p/54428#M13300</guid>
      <dc:creator>hexx</dc:creator>
      <dc:date>2020-09-28T10:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: After transaction: "Field '_raw' does not exist in the data"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/After-transaction-quot-Field-raw-does-not-exist-in-the-data-quot/m-p/54429#M13301</link>
      <description>&lt;P&gt;in 4.3, there's mvraw=true, which keeps _raw as a multivalued field&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2012 18:03:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/After-transaction-quot-Field-raw-does-not-exist-in-the-data-quot/m-p/54429#M13301</guid>
      <dc:creator>carasso</dc:creator>
      <dc:date>2012-04-10T18:03:26Z</dc:date>
    </item>
  </channel>
</rss>

