<?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: REX-Field Extraction Issues with Special Characters in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/REX-Field-Extraction-Issues-with-Special-Characters/m-p/566216#M197331</link>
    <description>&lt;P&gt;I am glad it helped.&amp;nbsp; Btw you can optimize your regular expression&lt;/P&gt;&lt;P&gt;You could for example use \d{4} instead of \d\d\d\d .&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can checkout a cheat sheet&amp;nbsp; like&amp;nbsp;&lt;A href="https://cheatography.com/davechild/cheat-sheets/regular-expressions/" target="_blank"&gt;https://cheatography.com/davechild/cheat-sheets/regular-expressions/&lt;/A&gt; for some useful commands &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Sep 2021 21:16:59 GMT</pubDate>
    <dc:creator>SaltyHash123</dc:creator>
    <dc:date>2021-09-07T21:16:59Z</dc:date>
    <item>
      <title>REX-Field Extraction Issues with Special Characters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-Field-Extraction-Issues-with-Special-Characters/m-p/566190#M197314</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have following Sample Event.&lt;/P&gt;&lt;P&gt;&lt;A href="mailto:Q17CNB_L_0__20210630-235755_5828.html@%5e@%5e2021/06/30@%5e@%5e23:57:55@%5e@%5eD7CNB@%5e@%5eselect" target="_blank"&gt;Q17CNB_L_0__20210630-235755_5828.html@^@^2021/06/30@^@^23:57:55@^@^&amp;nbsp;Q17CNB @^@^&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I have following REX command to extract &lt;STRONG&gt;ID&lt;/STRONG&gt; and &lt;STRONG&gt;DateTime&lt;/STRONG&gt; Fields from it&lt;/P&gt;&lt;P&gt;rex "(?&amp;lt;ID&amp;gt;.{6})&lt;A href="mailto:.*?@\%5e@\%5e(?%3cDateTime%3e\d\d\d\d\/\d\d\/\d\d@\%5e@\%5e\d\d:\d\d:\d\d)" target="_blank"&gt;.*?@\^@\^(?&amp;lt;DateTime&amp;gt;\d\d\d\d\/\d\d\/\d\d@\^@\^\d\d:\d\d:\d\d)&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;STRONG&gt;ID&lt;/STRONG&gt;&amp;nbsp;looked as expected, but I got&amp;nbsp;&lt;STRONG&gt;DateTime&lt;/STRONG&gt;&amp;nbsp;Field as &amp;nbsp;"&lt;STRONG&gt;2021/06/30@^@^23:57:55&lt;/STRONG&gt;"&amp;nbsp;. Is there anyways, we can have&amp;nbsp;&lt;STRONG&gt;DateTime&lt;/STRONG&gt;&amp;nbsp;Field like "&lt;STRONG&gt;2021/06/30 23:57:55&lt;/STRONG&gt;"....without (&lt;STRONG&gt;@^@^&lt;/STRONG&gt;) from this Event. Thank you so much, appreciate your support in these efforts.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 16:38:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-Field-Extraction-Issues-with-Special-Characters/m-p/566190#M197314</guid>
      <dc:creator>SplunkDash</dc:creator>
      <dc:date>2021-09-07T16:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: REX-Field Extraction Issues with Special Characters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-Field-Extraction-Issues-with-Special-Characters/m-p/566191#M197315</link>
      <description>&lt;P&gt;You could either replace the character with a space&lt;/P&gt;&lt;P&gt;something like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval dateField = replace(dateField,"@^", " ")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe you'll have to escape ^ with \^&lt;/P&gt;&lt;P&gt;otherwise you could create a field for the date and one for the time and append them into a new field (most probably less performance)&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 16:44:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-Field-Extraction-Issues-with-Special-Characters/m-p/566191#M197315</guid>
      <dc:creator>SaltyHash123</dc:creator>
      <dc:date>2021-09-07T16:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: REX-Field Extraction Issues with Special Characters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-Field-Extraction-Issues-with-Special-Characters/m-p/566192#M197316</link>
      <description>&lt;P&gt;Thank you so much, appreciate your support.&lt;/P&gt;&lt;P&gt;I think your codes is working as expected. I just have done some tweaking based on your recommendation ......working as expected. Here is the final code:&lt;/P&gt;&lt;P&gt;| rex "(?&amp;lt;ID&amp;gt;.{6})&lt;A href="mailto:.*?@\%5e@\%5e(?%3cDateTime%3e\d\d\d\d\/\d\d\/\d\d@\%5e@\%5e\d\d:\d\d:\d\d)" target="_blank" rel="noopener noreferrer"&gt;.*?@\^@\^(?&amp;lt;DateTime&amp;gt;\d\d\d\d\/\d\d\/\d\d@\^@\^\d\d:\d\d:\d\d)&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;| eval DateTime = replace(DateTime,"@\^@\^", " ")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 16:59:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-Field-Extraction-Issues-with-Special-Characters/m-p/566192#M197316</guid>
      <dc:creator>SplunkDash</dc:creator>
      <dc:date>2021-09-07T16:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: REX-Field Extraction Issues with Special Characters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-Field-Extraction-Issues-with-Special-Characters/m-p/566216#M197331</link>
      <description>&lt;P&gt;I am glad it helped.&amp;nbsp; Btw you can optimize your regular expression&lt;/P&gt;&lt;P&gt;You could for example use \d{4} instead of \d\d\d\d .&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can checkout a cheat sheet&amp;nbsp; like&amp;nbsp;&lt;A href="https://cheatography.com/davechild/cheat-sheets/regular-expressions/" target="_blank"&gt;https://cheatography.com/davechild/cheat-sheets/regular-expressions/&lt;/A&gt; for some useful commands &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 21:16:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-Field-Extraction-Issues-with-Special-Characters/m-p/566216#M197331</guid>
      <dc:creator>SaltyHash123</dc:creator>
      <dc:date>2021-09-07T21:16:59Z</dc:date>
    </item>
  </channel>
</rss>

