<?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: Modify _raw but keep extracted fields in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Modify-raw-but-keep-extracted-fields/m-p/404890#M71864</link>
    <description>&lt;P&gt;Hi Benoit,&lt;/P&gt;

&lt;P&gt;I am also running across this problem. If you found a solution, please share!&lt;/P&gt;

&lt;P&gt;-Alan&lt;/P&gt;</description>
    <pubDate>Sun, 17 Mar 2019 01:42:50 GMT</pubDate>
    <dc:creator>alanzchan</dc:creator>
    <dc:date>2019-03-17T01:42:50Z</dc:date>
    <item>
      <title>Modify _raw but keep extracted fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Modify-raw-but-keep-extracted-fields/m-p/404885#M71859</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;Today I encapsulate system logs in a JSON structure in order to add metadata that I would like to add to Splunk:&lt;/P&gt;

&lt;P&gt;Raw field:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; {"@metadata":
    {"type":"log","beat":"filebeat"},
    "beat":{
      "name":"server3",
      "hostname":"server3",
      "version":"5.4.0"},
    "fields":{
      "siteId":"Sweden"
      "source":"/root/log/currentLog.log"
      ,"offset":916645,
      "type":"log",
      "message": 2018-05-21T04:36:52.685 WARN: This is a warning",
      "@timestamp":"2018-05-21T02:37:27.919Z",
       "input_type":"log"
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The actual log line is in the "message" field. Because this is JSON, Splunk parses it easily and extracts the fields nicely. &lt;/P&gt;

&lt;P&gt;Now my issue is when I perform searches on this data, having the whole JSON structure in the _raw field is very cumbersome and prevents me from using the normal events viewer to browse the logs (because of all the extra information around the data i'm interested in)&lt;/P&gt;

&lt;P&gt;My questions:&lt;BR /&gt;
- Is there a way (via transforms/props) to replace _raw by the field "message" while keeping the fields saved at index time?&lt;BR /&gt;
-If the above solution is not possible/not clean, is there a way for me to somehow send metadata on top of _raw when i send the data via TCP?&lt;/P&gt;

&lt;P&gt;Thanks in advance,&lt;BR /&gt;
Benoit&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2018 04:49:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Modify-raw-but-keep-extracted-fields/m-p/404885#M71859</guid>
      <dc:creator>bntdumas</dc:creator>
      <dc:date>2018-05-21T04:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: Modify _raw but keep extracted fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Modify-raw-but-keep-extracted-fields/m-p/404886#M71860</link>
      <description>&lt;P&gt;The extracted fields from your JSON data are not created at index-time but at search-time, so somehow changing _raw from its JSON format will also break the field extraction.&lt;/P&gt;

&lt;P&gt;What kind of metadata are you missing in your current _raw that you'd want to include?&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2018 05:11:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Modify-raw-but-keep-extracted-fields/m-p/404886#M71860</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2018-05-21T05:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: Modify _raw but keep extracted fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Modify-raw-but-keep-extracted-fields/m-p/404887#M71861</link>
      <description>&lt;P&gt;if you want entire raw text in a message field then you can use &lt;CODE&gt;calculated fields&lt;/CODE&gt; knowledge objects.&lt;BR /&gt;
go to &lt;CODE&gt;Fields » Calculated fields » Add new&lt;/CODE&gt;&lt;BR /&gt;
Put necessary details and in eval Expression put &lt;CODE&gt;message=_raw&lt;/CODE&gt; and save.&lt;/P&gt;

&lt;P&gt;let me know if this helps!&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2018 05:45:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Modify-raw-but-keep-extracted-fields/m-p/404887#M71861</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-05-21T05:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Modify _raw but keep extracted fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Modify-raw-but-keep-extracted-fields/m-p/404888#M71862</link>
      <description>&lt;P&gt;Good to know for the JSON extraction.&lt;/P&gt;

&lt;P&gt;For the metadata, some of the fields I'm interested in are:&lt;BR /&gt;
- The original file as source (lost as I'm sending data via TCP)&lt;BR /&gt;
- The Site where the data is coming from (I thought about having one TCP input configured for each, but it's not very easy to maintain)&lt;/P&gt;

&lt;P&gt;There might be extra fields.&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2018 06:28:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Modify-raw-but-keep-extracted-fields/m-p/404888#M71862</guid>
      <dc:creator>bntdumas</dc:creator>
      <dc:date>2018-05-21T06:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: Modify _raw but keep extracted fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Modify-raw-but-keep-extracted-fields/m-p/404889#M71863</link>
      <description>&lt;P&gt;I would be more interested in _raw=message. &lt;BR /&gt;
Do you think it would be possible with calculated fields?&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2018 06:30:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Modify-raw-but-keep-extracted-fields/m-p/404889#M71863</guid>
      <dc:creator>bntdumas</dc:creator>
      <dc:date>2018-05-21T06:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Modify _raw but keep extracted fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Modify-raw-but-keep-extracted-fields/m-p/404890#M71864</link>
      <description>&lt;P&gt;Hi Benoit,&lt;/P&gt;

&lt;P&gt;I am also running across this problem. If you found a solution, please share!&lt;/P&gt;

&lt;P&gt;-Alan&lt;/P&gt;</description>
      <pubDate>Sun, 17 Mar 2019 01:42:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Modify-raw-but-keep-extracted-fields/m-p/404890#M71864</guid>
      <dc:creator>alanzchan</dc:creator>
      <dc:date>2019-03-17T01:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: Modify _raw but keep extracted fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Modify-raw-but-keep-extracted-fields/m-p/404891#M71865</link>
      <description>&lt;P&gt;I will suggest you to use " | fields - _raw" in your search to remove the raw data on the search time .&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2019 07:16:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Modify-raw-but-keep-extracted-fields/m-p/404891#M71865</guid>
      <dc:creator>SathyaNarayanan</dc:creator>
      <dc:date>2019-03-18T07:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: Modify _raw but keep extracted fields</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Modify-raw-but-keep-extracted-fields/m-p/404892#M71866</link>
      <description>&lt;P&gt;If you want to keep the metadata, and only show the message in the search results you could try this in your props.conf:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;props.conf&lt;/CODE&gt;&lt;BR /&gt;
&lt;PRE&gt;[my_sourcetype]&lt;BR /&gt;
EVAL-_raw = 'fields.message'&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;This will keep the other field information that was extracted, but only show the fields.message JSON data as the event.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:03:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Modify-raw-but-keep-extracted-fields/m-p/404892#M71866</guid>
      <dc:creator>jnudell_2</dc:creator>
      <dc:date>2020-09-30T01:03:37Z</dc:date>
    </item>
  </channel>
</rss>

