<?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 extract required data from the HEC _raw event and truncate the remaining information before indexing in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-required-data-from-the-HEC-raw-event-and-truncate/m-p/636134#M108807</link>
    <description>&lt;P&gt;BREAK_ONLY_BEFORE and BREAK_ONLY_AFTER are settings for when you have SHOULD_LINEMERGE set (which you should not have set unless there is really no other way).&lt;/P&gt;&lt;P&gt;To cut data from the event before indexing you'd normally use SEDCMD but there is one caveat - you must of course write proper regex. And with json it's kinda hard. You can't simply get anything from one brace to another because:&lt;/P&gt;&lt;P&gt;1) You can have nested entities. But even if you can assume that you won't have any "substructures" in your json,&lt;/P&gt;&lt;P&gt;2) A closing brace might be simply contained within a string.&lt;/P&gt;&lt;P&gt;You can use ingest-time eval to extract a given path from a json structure using json_extract() but that's "heavier" solution than simple regex-based operations.&lt;/P&gt;&lt;P&gt;So it's not that easy. The right approach will depend on the actual data you have and how much you can safely assume about its structure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Mar 2023 11:07:00 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2023-03-27T11:07:00Z</dc:date>
    <item>
      <title>How to extract required data from the HEC _raw event and truncate the remaining information before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-required-data-from-the-HEC-raw-event-and-truncate/m-p/636108#M108802</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;My single event length is too long so I want to extract and ingest the specific part from it. The part is in the middle of the event, so I tried extracting it using BREAK_ONLY_BEFORE and BREAK_ONLY_AFTER. Also used the LINE_BREAKER function but it is not working as expected. How can we define start and end of the log in the props.conf file? Is there any alternative to achieve this?&lt;BR /&gt;&lt;BR /&gt;Log sample:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Charlize_0-1679905768527.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/24547i94FF8AF0C5560097/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Charlize_0-1679905768527.png" alt="Charlize_0-1679905768527.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 08:34:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-required-data-from-the-HEC-raw-event-and-truncate/m-p/636108#M108802</guid>
      <dc:creator>Charlize</dc:creator>
      <dc:date>2023-03-27T08:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract required data from the HEC _raw event and truncate the remaining information before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-required-data-from-the-HEC-raw-event-and-truncate/m-p/636134#M108807</link>
      <description>&lt;P&gt;BREAK_ONLY_BEFORE and BREAK_ONLY_AFTER are settings for when you have SHOULD_LINEMERGE set (which you should not have set unless there is really no other way).&lt;/P&gt;&lt;P&gt;To cut data from the event before indexing you'd normally use SEDCMD but there is one caveat - you must of course write proper regex. And with json it's kinda hard. You can't simply get anything from one brace to another because:&lt;/P&gt;&lt;P&gt;1) You can have nested entities. But even if you can assume that you won't have any "substructures" in your json,&lt;/P&gt;&lt;P&gt;2) A closing brace might be simply contained within a string.&lt;/P&gt;&lt;P&gt;You can use ingest-time eval to extract a given path from a json structure using json_extract() but that's "heavier" solution than simple regex-based operations.&lt;/P&gt;&lt;P&gt;So it's not that easy. The right approach will depend on the actual data you have and how much you can safely assume about its structure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 11:07:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-required-data-from-the-HEC-raw-event-and-truncate/m-p/636134#M108807</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-03-27T11:07:00Z</dc:date>
    </item>
  </channel>
</rss>

