<?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: Field extract from Rex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655935#M226541</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;@Whatever you provided rex expression is not fetching the values&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Aug 2023 09:36:06 GMT</pubDate>
    <dc:creator>Sangamesh</dc:creator>
    <dc:date>2023-08-29T09:36:06Z</dc:date>
    <item>
      <title>How to do Field extraction from Rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655041#M226282</link>
      <description>&lt;P&gt;I need to extract the values between &amp;gt;&amp;gt;&amp;gt;&amp;gt;||&amp;nbsp; ||&amp;nbsp; and after the &amp;gt;&amp;gt;&amp;gt;&amp;gt;|| || referring the below sample and output should be like&lt;/P&gt;
&lt;P&gt;values between&amp;gt;&amp;gt;&amp;gt;&amp;gt;||1407|| should be temp=1407&lt;/P&gt;
&lt;P&gt;values after &amp;gt;&amp;gt;&amp;gt;&amp;gt;||1407|| should be message=[POD CleanUp] File deleted from POD : /dfgd/dfgdfgdfg.dat&lt;/P&gt;
&lt;P&gt;Here is the sample log:&lt;/P&gt;
&lt;P&gt;{"source":"fdgdfdfg","log":"2023-08-21 04:07:12.400 INFO 42 --- [dfgdf] c.j.t.f.dgf.dfgd.dgf : &amp;gt;&amp;gt;&amp;gt;&amp;gt;||1407|| [POD CleanUp] File deleted from POD : /dfgd/dfgdfgdfg.dat","host":"xx-ret353.svr.gg.fghs.net","tags":["_dateparsefailure"],"@version":"1","Kubernetes.pod":"gkp-xcs-services-black-prd-67986d784-b6c5j","s_sourcetype":"tyu","@timestamp":"2023-08-21T08:07:28.420Z","Kubernetes.namespace":"80578d64606-56-fyt-ty-prod","appId":"1235","app_id":"2345","log_file":"/app/logs/app.log","Kubernetes.node":"sd-1564sw32b0f.svr.us.sdf.net"}&lt;/P&gt;
&lt;P&gt;@&lt;SPAN&gt;ITWhisperer&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2023 19:51:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655041#M226282</guid>
      <dc:creator>Sangamesh</dc:creator>
      <dc:date>2023-08-21T19:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Field extract from Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655044#M226284</link>
      <description>&lt;P&gt;This looks like JSON, so assuming you have already extract the log field, try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=log "&amp;gt;&amp;gt;&amp;gt;&amp;gt;\|\|(?&amp;lt;temp&amp;gt;[^\|]+)\|\|\s(?&amp;lt;message&amp;gt;.+)"&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 21 Aug 2023 14:40:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655044#M226284</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-08-21T14:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Field extract from Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655327#M226380</link>
      <description>&lt;P&gt;How to extract these fields timestamp,kubernetes.pod too along with the below provided solutions&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2023 13:18:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655327#M226380</guid>
      <dc:creator>Sangamesh</dc:creator>
      <dc:date>2023-08-23T13:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: Field extract from Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655328#M226381</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;one way to do it use separate rex expressions. Then it's not dependent on order of those values in your log message. If you could be sure that order is always same then you can add all in one or to rex. As you have json (based on your examples) you could also use extract/kv command to extract those fields like json.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
| rex "timestamp\":\"(?&amp;lt;timestamp&amp;gt;\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d.\d{3}[^\"]+)"
| rex "Kubernetes\.pod\":\"(?&amp;lt;kubernets_pod&amp;gt;[^\"]+)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;r. Ismo&amp;nbsp;&lt;/P&gt;&lt;P&gt;Added missed ) for 1st one.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2023 13:54:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655328#M226381</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-08-23T13:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Field extract from Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655333#M226382</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;&amp;nbsp;@Whatever you provided solution not extracting the timestamp and Kubernetes.pod&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2023 13:50:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655333#M226382</guid>
      <dc:creator>Sangamesh</dc:creator>
      <dc:date>2023-08-23T13:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: Field extract from Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655337#M226383</link>
      <description>&lt;P&gt;Based on your example this should works after I fix/add missed ) on timestamp part.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Timestamps&amp;nbsp;&lt;A href="https://regex101.com/r/QkHusK/1" target="_blank"&gt;https://regex101.com/r/QkHusK/1&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Kubernetes.pod &lt;A href="https://regex101.com/r/vWFIMe/1" target="_blank"&gt;https://regex101.com/r/vWFIMe/1&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 23 Aug 2023 13:57:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655337#M226383</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-08-23T13:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Field extract from Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655338#M226384</link>
      <description>&lt;P&gt;Given that this looks like JSON, you should either already have these fields if you have ingested the log correctly, or you could use spath to extract them. If you want to continue with rex for these fields, try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "timestamp\":\"(?&amp;lt;timestamp&amp;gt;[^\"]+)"
| rex "Kubernetes.pod\":\"(?&amp;lt;kubernetes_pod&amp;gt;[^\"]+)"&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 23 Aug 2023 13:58:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655338#M226384</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-08-23T13:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: Field extract from Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655833#M226513</link>
      <description>&lt;P&gt;I see couple of logs starting with this log format too &amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;||1407||&lt;/P&gt;&lt;P&gt;could you please provide the Rex expression with already provided solution&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 12:23:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655833#M226513</guid>
      <dc:creator>Sangamesh</dc:creator>
      <dc:date>2023-08-28T12:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Field extract from Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655914#M226528</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;@Will you able to provide the Rex for the below log format too.&lt;/P&gt;&lt;P&gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;&amp;lt;&amp;gt;||1407||&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 07:03:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655914#M226528</guid>
      <dc:creator>Sangamesh</dc:creator>
      <dc:date>2023-08-29T07:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: Field extract from Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655918#M226531</link>
      <description>&lt;LI-CODE lang="markup"&gt;| rex field=log "\&amp;lt;&amp;gt;\&amp;lt;&amp;gt;\&amp;lt;&amp;gt;\&amp;lt;&amp;gt;\|\|(?&amp;lt;temp&amp;gt;[^\|]+)\|\|\s(?&amp;lt;message&amp;gt;.+)"&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 29 Aug 2023 07:50:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655918#M226531</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-08-29T07:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: Field extract from Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655935#M226541</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;@Whatever you provided rex expression is not fetching the values&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 09:36:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655935#M226541</guid>
      <dc:creator>Sangamesh</dc:creator>
      <dc:date>2023-08-29T09:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: Field extract from Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655936#M226542</link>
      <description>&lt;P&gt;Please share the complete event which is not working for you (anonymised of course). Please use a code block &amp;lt;/&amp;gt; so the formatting and special characters are preserved.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 09:40:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-Field-extraction-from-Rex/m-p/655936#M226542</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-08-29T09:40:43Z</dc:date>
    </item>
  </channel>
</rss>

