<?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 fields from _raw event? in Splunk Cloud Platform</title>
    <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-extract-fields-from-raw-event/m-p/659024#M2531</link>
    <description>&lt;P&gt;Here is an example to get Fruit Timestamp and Message&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="[August 28, 2023 7:22:45 PM EDT] APPLE Interface IF-abcef23fw2/31 [WAN14] Disabled (100%) Designate that a disabled port or surface is the root cause. This event can be circumvent by setting the SuppressDisabledAlerts to FALSE."
| rex "^\[(?&amp;lt;Timestamp&amp;gt;[^\]]*)\] (?&amp;lt;Fruit&amp;gt;\w+)\s+(?&amp;lt;Message&amp;gt;.*)"&lt;/LI-CODE&gt;&lt;P&gt;it's impossible - without knowing more - to extract Test from Message&lt;/P&gt;&lt;P&gt;You could do this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=Message "(?&amp;lt;Test&amp;gt;.*100%\))"&lt;/LI-CODE&gt;&lt;P&gt;but all that is doing is saying that Test will be extracted up to a string ending in &lt;STRONG&gt;100%)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Does Test have any definining characteristics?&lt;/P&gt;</description>
    <pubDate>Fri, 29 Sep 2023 02:04:57 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2023-09-29T02:04:57Z</dc:date>
    <item>
      <title>How to extract fields from _raw event?</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-extract-fields-from-raw-event/m-p/659023#M2530</link>
      <description>&lt;P&gt;Hi Splunkers,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to extract the fields from the&lt;STRONG&gt; raw event&lt;/STRONG&gt; can you help if this can be done through rex or substr and provide examples if possible.&lt;/P&gt;&lt;P&gt;Sample Event&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;August 28, 2023 7:22:45 PM EDT&lt;SPAN&gt;] &lt;/SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;APPLE&lt;/STRONG&gt; Interface IF-abcef23fw2/31&lt;/SPAN&gt; [WAN14] Disabled (100%) &lt;SPAN&gt;Designate that a disabled port or surface is the root cause. This event can be circumvent by setting the SuppressDisabledAlerts to FALSE.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Expected new fields&amp;nbsp;as follows&amp;nbsp;&lt;BR /&gt;1 ) Fruit =&amp;nbsp;&lt;STRONG&gt;APPLE&lt;/STRONG&gt;&lt;BR /&gt;2) Test =&amp;nbsp;&lt;STRONG&gt;Interface IF-abcef23fw2/31 [WAN14] Disabled (100%)&lt;BR /&gt;&lt;/STRONG&gt;3) Timestamp =&amp;nbsp;&lt;STRONG&gt;August 28, 2023 7:22:45 PM EDT&lt;BR /&gt;&lt;/STRONG&gt;4) Message =&amp;nbsp;&lt;STRONG&gt;Interface IF-abcef23fw2/31 [WAN14] Disabled (100%) Designate that a disabled port or surface is the root cause. This event can be circumvent by setting the SuppressDisabledAlerts to FALSE.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please Advise&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 00:46:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-extract-fields-from-raw-event/m-p/659023#M2530</guid>
      <dc:creator>iamsplunker</dc:creator>
      <dc:date>2023-09-29T00:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields from _raw event?</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-extract-fields-from-raw-event/m-p/659024#M2531</link>
      <description>&lt;P&gt;Here is an example to get Fruit Timestamp and Message&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="[August 28, 2023 7:22:45 PM EDT] APPLE Interface IF-abcef23fw2/31 [WAN14] Disabled (100%) Designate that a disabled port or surface is the root cause. This event can be circumvent by setting the SuppressDisabledAlerts to FALSE."
| rex "^\[(?&amp;lt;Timestamp&amp;gt;[^\]]*)\] (?&amp;lt;Fruit&amp;gt;\w+)\s+(?&amp;lt;Message&amp;gt;.*)"&lt;/LI-CODE&gt;&lt;P&gt;it's impossible - without knowing more - to extract Test from Message&lt;/P&gt;&lt;P&gt;You could do this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=Message "(?&amp;lt;Test&amp;gt;.*100%\))"&lt;/LI-CODE&gt;&lt;P&gt;but all that is doing is saying that Test will be extracted up to a string ending in &lt;STRONG&gt;100%)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Does Test have any definining characteristics?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 02:04:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-extract-fields-from-raw-event/m-p/659024#M2531</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-09-29T02:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields from _raw event?</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-extract-fields-from-raw-event/m-p/659026#M2532</link>
      <description>&lt;P&gt;Thanks for your response&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To answer your question all I wanted to extract &amp;nbsp;is “Test” until 100% from “Interface”&lt;/P&gt;&lt;P&gt;the characteristics are&lt;/P&gt;&lt;P&gt;1)the event may have 30% or 40% instead of 100%&lt;/P&gt;&lt;P&gt;2) Instead of “Interface” it may have string like “Machine” or “Device”&lt;/P&gt;&lt;P&gt;lastly I wanted to save all these Rex as individual inline extractions 1) Fruit 2) Timestamp 3) Test 4) Message so that I don’t have to define |rex at search time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 02:39:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-extract-fields-from-raw-event/m-p/659026#M2532</guid>
      <dc:creator>iamsplunker</dc:creator>
      <dc:date>2023-09-29T02:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields from _raw event?</title>
      <link>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-extract-fields-from-raw-event/m-p/659030#M2533</link>
      <description>&lt;P&gt;So, the regex for the Test extraction is the first part of the message up to a % value, so use this, so it looks for one or more numbers before the %)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=Message "(?&amp;lt;Test&amp;gt;.*\d+%\))"&lt;/LI-CODE&gt;&lt;P&gt;As for making them Field extractions, just define them in the field extractions/transforms section of the Fields menu - I think you will have to use 2 extractions as the Test is a subset of the Message, so will require a transform, unless you make 2 regexes to extract first 3 fields then just the Test field&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 03:37:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Cloud-Platform/How-to-extract-fields-from-raw-event/m-p/659030#M2533</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-09-29T03:37:58Z</dc:date>
    </item>
  </channel>
</rss>

