<?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: specific field extraction from _raw event data/message in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/specific-field-extraction-from-raw-event-data-message/m-p/577027#M201101</link>
    <description>Hi&lt;BR /&gt;it seems that your event's is not correct json format (e.g. missing : and , characters). Is it possible that logging system will fix those (the best option) or should you fix those (if many events with many formats, this will be quite hard task)?&lt;BR /&gt;r. Ismo</description>
    <pubDate>Thu, 02 Dec 2021 11:35:05 GMT</pubDate>
    <dc:creator>isoutamo</dc:creator>
    <dc:date>2021-12-02T11:35:05Z</dc:date>
    <item>
      <title>specific field extraction from _raw event data/message</title>
      <link>https://community.splunk.com/t5/Splunk-Search/specific-field-extraction-from-raw-event-data-message/m-p/577003#M201093</link>
      <description>&lt;P&gt;I have event data from the search result in format as shown in the image, now I want to extract the following fields with their corresponding values excluding the remaining fields or data from the event data/string:&lt;/P&gt;&lt;P&gt;id =&amp;nbsp;&lt;SPAN class=""&gt;b0ad6627-a6e1-4f5e-92f4-9c2deaa1ff2a&lt;/SPAN&gt;&lt;SPAN&gt;_&lt;/SPAN&gt;&lt;SPAN class=""&gt;1cd4b06f83caac09&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;start_date_time =&amp;nbsp;&lt;SPAN&gt;1638433382 (value always required)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;end_date_time = null or&amp;nbsp;&lt;SPAN&gt;1638433491&amp;nbsp; (if value not present)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;current = &amp;lt;value&amp;gt; (only if the field exist) (6 in the example)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;total = &amp;lt;value&amp;gt; (6 in the example)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;status_type = COMPLETED&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;bot_uri =&amp;nbsp;&lt;SPAN class=""&gt;repository:///Automation&lt;/SPAN&gt;%20&lt;SPAN class=""&gt;Anywhere/Bots/Test&lt;/SPAN&gt;%20&lt;SPAN class=""&gt;A2019/AALogTestBot&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried using &amp;lt;search query&amp;gt; | rex field=_raw "(?msi)(?&amp;lt;ev_field&amp;gt;\{.+\}$)"&lt;BR /&gt;| spath input=ev_field&amp;nbsp; to extract all the fields in the Event data, but did not change the search results. Any suggestion or help highly appreciated I am newbie to Splunk...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;TIA&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ssamant007_0-1638434187803.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/17085iEBBDD4DA48875659/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ssamant007_0-1638434187803.png" alt="ssamant007_0-1638434187803.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;12/2/21&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;7:24:52.106 PM&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;2021-Dec-02&lt;/SPAN&gt; &lt;SPAN class=""&gt;Thu&lt;/SPAN&gt; &lt;SPAN class=""&gt;19:24:52.106&lt;/SPAN&gt; &lt;SPAN class=""&gt;INFO&lt;/SPAN&gt; [&lt;SPAN class=""&gt;pool-12-thread-1&lt;/SPAN&gt;] &lt;SPAN class=""&gt;-&lt;/SPAN&gt; &lt;SPAN class=""&gt;com.automationanywhere.nodemanager.service.impl.NodeMessagingServiceImpl&lt;/SPAN&gt; &lt;SPAN class=""&gt;-&lt;/SPAN&gt; {} &lt;SPAN class=""&gt;-&lt;/SPAN&gt; &lt;SPAN class=""&gt;writeSuccess&lt;/SPAN&gt;(&lt;SPAN class=""&gt;NodeMessagingServiceImpl.java:395&lt;/SPAN&gt;) &lt;SPAN class=""&gt;-&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Message&lt;/SPAN&gt; &lt;SPAN class=""&gt;eventData&lt;/SPAN&gt;&lt;/SPAN&gt; { &lt;SPAN class=""&gt;id:&lt;/SPAN&gt; "&lt;SPAN class=""&gt;b0ad6627-a6e1-4f5e-92f4-9c2deaa1ff2a_1cd4b06f83caac09&lt;/SPAN&gt;" &lt;SPAN class=""&gt;bot_execution&lt;/SPAN&gt; { &lt;SPAN class=""&gt;start_date_time&lt;/SPAN&gt; { &lt;SPAN class=""&gt;seconds:&lt;/SPAN&gt; &lt;SPAN class=""&gt;1638433382&lt;/SPAN&gt; &lt;SPAN class=""&gt;nanos:&lt;/SPAN&gt; &lt;SPAN class=""&gt;210329300&lt;/SPAN&gt; } &lt;SPAN class=""&gt;end_date_time&lt;/SPAN&gt; { &lt;SPAN class=""&gt;seconds:&lt;/SPAN&gt; &lt;SPAN class=""&gt;1638433491&lt;/SPAN&gt; &lt;SPAN class=""&gt;nanos:&lt;/SPAN&gt; &lt;SPAN class=""&gt;993822800&lt;/SPAN&gt; } &lt;SPAN class=""&gt;progress&lt;/SPAN&gt; { &lt;SPAN class=""&gt;current:&lt;/SPAN&gt; &lt;SPAN class=""&gt;6&lt;/SPAN&gt; &lt;SPAN class=""&gt;total:&lt;/SPAN&gt; &lt;SPAN class=""&gt;6&lt;/SPAN&gt; &lt;SPAN class=""&gt;percentage:&lt;/SPAN&gt; &lt;SPAN class=""&gt;100&lt;/SPAN&gt; } &lt;SPAN class=""&gt;status_type:&lt;/SPAN&gt; &lt;SPAN class=""&gt;COMPLETED&lt;/SPAN&gt; &lt;SPAN class=""&gt;bot_uri:&lt;/SPAN&gt; "&lt;SPAN class=""&gt;repository:///Automation&lt;/SPAN&gt;%20&lt;SPAN class=""&gt;Anywhere/Bots/Test&lt;/SPAN&gt;%20&lt;SPAN class=""&gt;A2019/AALogTestBot&lt;/SPAN&gt;?&lt;SPAN class=""&gt;fileId=1098948&lt;/SPAN&gt;&amp;amp;&lt;SPAN class=""&gt;workspace=PRIVATE&lt;/SPAN&gt;" }} &lt;SPAN class=""&gt;sent&lt;/SPAN&gt; &lt;SPAN class=""&gt;to&lt;/SPAN&gt; &lt;SPAN class=""&gt;CR&lt;/SPAN&gt; &lt;SPAN class=""&gt;successfully.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 08:47:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/specific-field-extraction-from-raw-event-data-message/m-p/577003#M201093</guid>
      <dc:creator>ssamant007</dc:creator>
      <dc:date>2021-12-02T08:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: specific field extraction from _raw event data/message</title>
      <link>https://community.splunk.com/t5/Splunk-Search/specific-field-extraction-from-raw-event-data-message/m-p/577027#M201101</link>
      <description>Hi&lt;BR /&gt;it seems that your event's is not correct json format (e.g. missing : and , characters). Is it possible that logging system will fix those (the best option) or should you fix those (if many events with many formats, this will be quite hard task)?&lt;BR /&gt;r. Ismo</description>
      <pubDate>Thu, 02 Dec 2021 11:35:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/specific-field-extraction-from-raw-event-data-message/m-p/577027#M201101</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2021-12-02T11:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: specific field extraction from _raw event data/message</title>
      <link>https://community.splunk.com/t5/Splunk-Search/specific-field-extraction-from-raw-event-data-message/m-p/577029#M201102</link>
      <description>&lt;P&gt;Without fixing the source event you can try this with normal rex extractions like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw = "INFO [pool-12-thread-1] - com.automationanywhere.nodemanager.service.impl.NodeMessagingServiceImpl - {} - writeSuccess(NodeMessagingServiceImpl.java:395) - Message eventData { id: \"b0ad6627-a6e1-4f5e-92f4-9c2deaa1ff2a_1cd4b06f83caac09\" bot_execution { start_date_time { seconds: 1638433382 nanos: 210329300 } end_date_time { seconds: 1638433491 nanos: 993822800 } progress { current: 6 total: 6 percentage: 100 } status_type: COMPLETED bot_uri: \"repository:///Automation%20Anywhere/Bots/Test%20A2019/AALogTestBot?fileId=1098948&amp;amp;workspace=PRIVATE\" }} sent to CR successfully."
``` Above create test event```

| rex "id: \"(?&amp;lt;id&amp;gt;[^\"]+)"
| rex "start_date_time { seconds: (?&amp;lt;start_date_time&amp;gt;\d+)"
| rex "end_date_time { seconds: (?&amp;lt;end_date_time&amp;gt;\d+)"
| rex "current: (?&amp;lt;current&amp;gt;\d+)"
| rex "total: (?&amp;lt;total&amp;gt;\d+)"
| rex "status_type: (?&amp;lt;status_type&amp;gt;\w+)"
| rex "bot_uri: \"(?&amp;lt;bot_uri&amp;gt;[^\"]+)"
| table id start_date_time end_date_time current total status_type bot_uri&lt;/LI-CODE&gt;&lt;P&gt;If your events have fixed format you probably could combine some rex together, but then you should look from job inspector which mode is more efficient.&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 11:45:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/specific-field-extraction-from-raw-event-data-message/m-p/577029#M201102</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2021-12-02T11:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: specific field extraction from _raw event data/message</title>
      <link>https://community.splunk.com/t5/Splunk-Search/specific-field-extraction-from-raw-event-data-message/m-p/577033#M201103</link>
      <description>&lt;P&gt;This is one way of doing it....&lt;BR /&gt;I've currently set&amp;nbsp;end_date_time &amp;amp; Current to default to null if there is no value.&lt;BR /&gt;If you want you can set Current to 0 if it doesn't exist by adding one more line&lt;BR /&gt;| fillnull value=0 Current&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw= "2021-Dec-02 Thu 19:24:52.106 INFO [pool-12-thread-1] - com.automationanywhere.nodemanager.service.impl.NodeMessagingServiceImpl - {} - writeSuccess(NodeMessagingServiceImpl.java:395) - Message eventData { id: \"b0ad6627-a6e1-4f5e-92f4-9c2deaa1ff2a_1cd4b06f83caac09\" bot_execution { start_date_time { seconds: 1638433382 nanos: 210329300 } end_date_time { seconds: 1638433491 nanos: 993822800 } progress { current: 6 total: 6 percentage: 100 } status_type: COMPLETED bot_uri: \"repository:///Automation%20Anywhere/Bots/Test%20A2019/AALogTestBot?fileId=1098948&amp;amp;workspace=PRIVATE\" }} sent to CR successfully." 
| rex field=_raw "id\:\s\"(?&amp;lt;ID&amp;gt;[a-z0-9\-\_]+)\"\s" 
| rex field=_raw "start\_date\_time\s\{\sseconds\:\s(?&amp;lt;start_date_time&amp;gt;[\d]+)\s" 
| rex field=_raw "end\_date\_time\s\{\sseconds\:\s(?&amp;lt;end_date_time&amp;gt;[\d]+)\s" 
| rex field=_raw "\{\scurrent\:\s(?&amp;lt;Current&amp;gt;[\d]+)\stotal" 
| rex field=_raw "\stotal\:\s(?&amp;lt;Total&amp;gt;[\d]+)\s" 
| rex field=_raw "status\_type\:\s(?&amp;lt;Status&amp;gt;[\w]+)\s" 
| rex field=_raw "bot_uri\:\s\"(?&amp;lt;bot_uri&amp;gt;.*)\?" 
| table _time _raw ID start_date_time end_date_time Current Total Status bot_uri 
| fillnull value=null end_date_time Current&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Gr0und_Z3r0_0-1638446324206.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/17093iC4052FFA1FF8ECA0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Gr0und_Z3r0_0-1638446324206.png" alt="Gr0und_Z3r0_0-1638446324206.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;If it helps, an upvote would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 12:01:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/specific-field-extraction-from-raw-event-data-message/m-p/577033#M201103</guid>
      <dc:creator>Gr0und_Z3r0</dc:creator>
      <dc:date>2021-12-02T12:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: specific field extraction from _raw event data/message</title>
      <link>https://community.splunk.com/t5/Splunk-Search/specific-field-extraction-from-raw-event-data-message/m-p/577038#M201104</link>
      <description>&lt;P&gt;Adding to all other good answers - what do you mean by excluding remaining fields/data?&lt;/P&gt;&lt;P&gt;&amp;nbsp;If you want to only operate further in the search on those extracted fields and will definitely not need the raw event, you might just&lt;/P&gt;&lt;PRE&gt;| fields - _raw&lt;/PRE&gt;&lt;P&gt;to tell splunk not to bother with the original event.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 12:12:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/specific-field-extraction-from-raw-event-data-message/m-p/577038#M201104</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-12-02T12:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: specific field extraction from _raw event data/message</title>
      <link>https://community.splunk.com/t5/Splunk-Search/specific-field-extraction-from-raw-event-data-message/m-p/577174#M201143</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/240999"&gt;@Gr0und_Z3r0&lt;/a&gt;&amp;nbsp;. this is what I was looking for.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2021 04:16:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/specific-field-extraction-from-raw-event-data-message/m-p/577174#M201143</guid>
      <dc:creator>ssamant007</dc:creator>
      <dc:date>2021-12-03T04:16:38Z</dc:date>
    </item>
  </channel>
</rss>

