<?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: Regular expression to split a string into multiple strings based on a delimiter. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression-to-split-a-string-into-multiple-strings-based/m-p/365329#M107754</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/50738"&gt;@rajim&lt;/a&gt;, since your data will have field names at specific location after every delimiter you can try the following run anywhere search and replace first two commands i.e. makeresults and eval _raw with your current base search. PS: There is one additional directory  between &lt;CODE&gt;Source_File_Extension&lt;/CODE&gt; and &lt;CODE&gt;Was_Blocked&lt;/CODE&gt; which you have not extracted, because of which I have filled a &lt;CODE&gt;someOtherDirectory&lt;/CODE&gt; field, not know which of the directly sequence is incorrect.&lt;BR /&gt;
Also I have not written the regular expression to extract &lt;CODE&gt;Agent_UTC_Time&lt;/CODE&gt; as the same should be extracted as _time in your &lt;CODE&gt;props.conf&lt;/CODE&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw="12/23/2017 12:37:06 PM#@#@Copying to removable media#@#@DEFAULT#@#@RUR90M4417#@#@File Copy#@#@20_xiamen wingtas_wk2017381_ci.pdf#@#@2.7314186096191406#@#@pdf#@#@c:\users\ichemiakin001\desktop\???????????? ???????? ?? ????????????? ?????? ???????? ??????????? test cost of sales transactions - trade entity\??????? ???????\??\#@#@c:\users\ichemiakin001\desktop\???????????? ???????? ?? ????????????? ?????? ???????? ??????????? test cost of sales transactions - trade entity\??????? ???????\??\20_xiamen wingtas_wk2017381_ci.pdf#@#@g:\assurance\clients\mm\sportmaster group\2017\sportmaster ifrs audit\office file\???????????? ???????? ?? ????????????? ?????? ???????? ??????????? test cost of sales transactions - trade entity\??????? ???????\??\#@#@g:\assurance\clients\mm\sportmaster group\2017\sportmaster ifrs audit\office file\???????????? ???????? ?? ????????????? ?????? ???????? ??????????? test cost of sales transactions - trade entity\??????? ???????\??\#@#@False#@#@False#@#@explorer.exe#@#@Operation monitored, File not saved"
| rex "#@#@(?&amp;lt;value&amp;gt;[^#]+)" max_match=15
| eval etype=mvindex(value,0),CountryCode=mvindex(value,1),ComputerName=mvindex(value,2),Operation=mvindex(value,3),Source_File=mvindex(value,4),Detail_File_Size_MB=mvindex(value,5),Source_File_Extension=mvindex(value,6),Source_Directory=mvindex(value,7),Destination_Directory=mvindex(value,8),destination=mvindex(value,9),someOtherDirectory=mvindex(value,10),Was_Blocked=mvindex(value,11),Was_File_Captured=mvindex(value,12),Application=mvindex(value,13),action=mvindex(value,14)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please try out and confirm.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 17:21:52 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2020-09-29T17:21:52Z</dc:date>
    <item>
      <title>Regular expression to split a string into multiple strings based on a delimiter.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression-to-split-a-string-into-multiple-strings-based/m-p/365327#M107752</link>
      <description>&lt;P&gt;In my search, I have a field that have a String like below. I want to split this string into multiple strings based on "#@#@". Please help me to write a correct regular expression for this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;12/23/2017 12:37:06 PM#@#@Copying to removable media#@#@DEFAULT#@#@RUR90M4417#@#@File Copy#@#@20_xiamen wingtas_wk2017381_ci.pdf#@#@2.7314186096191406#@#@pdf#@#@c:\users\ichemiakin001\desktop\???????????? ???????? ?? ????????????? ?????? ???????? ??????????? test cost of sales transactions - trade entity\??????? ???????\??\#@#@c:\users\ichemiakin001\desktop\???????????? ???????? ?? ????????????? ?????? ???????? ??????????? test cost of sales transactions - trade entity\??????? ???????\??\20_xiamen wingtas_wk2017381_ci.pdf#@#@g:\assurance\clients\mm\sportmaster group\2017\sportmaster ifrs audit\office file\???????????? ???????? ?? ????????????? ?????? ???????? ??????????? test cost of sales transactions - trade entity\??????? ???????\??\#@#@g:\assurance\clients\mm\sportmaster group\2017\sportmaster ifrs audit\office file\???????????? ???????? ?? ????????????? ?????? ???????? ??????????? test cost of sales transactions - trade entity\??????? ???????\??\#@#@False#@#@False#@#@explorer.exe#@#@Operation monitored, File not saved
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have tried the below regex. But it's not working properly.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=allRequiredFields "^(?&amp;lt;Agent_UTC_Time&amp;gt;.*)#@#@(?&amp;lt;etype&amp;gt;.*)#@#@(?&amp;lt;CountryCode&amp;gt;.*)#@#@(?&amp;lt;ComputerName&amp;gt;.*)#@#@(?&amp;lt;Operation&amp;gt;.*)#@#@(?&amp;lt;Source_File&amp;gt;.*)#@#@(?&amp;lt;Detail_File_Size_MB&amp;gt;.*)#@#@(?&amp;lt;Source_File_Extension&amp;gt;.*)#@#@(?&amp;lt;Source_Directory&amp;gt;.*)#@#@(?&amp;lt;Destination_Directory&amp;gt;.*)#@#@(?&amp;lt;destination&amp;gt;.*)#@#@(?&amp;lt;Was_Blocked&amp;gt;.*)#@#@(?&amp;lt;Was_File_Captured&amp;gt;.*)#@#@(?&amp;lt;Application&amp;gt;.*)#@#@(?&amp;lt;action&amp;gt;.*)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 23 Dec 2017 15:08:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-expression-to-split-a-string-into-multiple-strings-based/m-p/365327#M107752</guid>
      <dc:creator>rajim</dc:creator>
      <dc:date>2017-12-23T15:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression to split a string into multiple strings based on a delimiter.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression-to-split-a-string-into-multiple-strings-based/m-p/365328#M107753</link>
      <description>&lt;P&gt;Hi Rajim,&lt;/P&gt;

&lt;P&gt;Try this instead: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=allRequiredFields "^(?&amp;lt;Agent_UTC_Time&amp;gt;[^#@]+)[#@]+(?&amp;lt;etype&amp;gt;[^#@]+)[#@]+(?&amp;lt;CountryCode&amp;gt;[^#@]+)[#@]+(?&amp;lt;ComputerName&amp;gt;[^#@]+)[#@]+(?&amp;lt;Operation&amp;gt;[^#@]+)[#@]+(?&amp;lt;Source_File&amp;gt;[^#@]+)[#@]+(?&amp;lt;Detail_File_Size_MB&amp;gt;[^#@]+)[#@]+(?&amp;lt;Source_File_Extension&amp;gt;[^#@]+)[#@]+(?&amp;lt;Source_Directory&amp;gt;[^#@]+)[#@]+(?&amp;lt;Destination_Directory&amp;gt;[^#@]+)[#@]+(?&amp;lt;destination&amp;gt;[^#@]+)[#@]+(?&amp;lt;Was_Blocked&amp;gt;[^#@]+)[#@]+(?&amp;lt;Was_File_Captured&amp;gt;[^#@]+)[#@]+(?&amp;lt;Application&amp;gt;[^#@]+)[#@]+(?&amp;lt;action&amp;gt;[^#@]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried it on &lt;A href="https://regex101.com/"&gt;https://regex101.com/&lt;/A&gt; it's working but I think you're missing a field somewhere, you'll just have to add it in.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Sat, 23 Dec 2017 17:41:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-expression-to-split-a-string-into-multiple-strings-based/m-p/365328#M107753</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2017-12-23T17:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression to split a string into multiple strings based on a delimiter.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression-to-split-a-string-into-multiple-strings-based/m-p/365329#M107754</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/50738"&gt;@rajim&lt;/a&gt;, since your data will have field names at specific location after every delimiter you can try the following run anywhere search and replace first two commands i.e. makeresults and eval _raw with your current base search. PS: There is one additional directory  between &lt;CODE&gt;Source_File_Extension&lt;/CODE&gt; and &lt;CODE&gt;Was_Blocked&lt;/CODE&gt; which you have not extracted, because of which I have filled a &lt;CODE&gt;someOtherDirectory&lt;/CODE&gt; field, not know which of the directly sequence is incorrect.&lt;BR /&gt;
Also I have not written the regular expression to extract &lt;CODE&gt;Agent_UTC_Time&lt;/CODE&gt; as the same should be extracted as _time in your &lt;CODE&gt;props.conf&lt;/CODE&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw="12/23/2017 12:37:06 PM#@#@Copying to removable media#@#@DEFAULT#@#@RUR90M4417#@#@File Copy#@#@20_xiamen wingtas_wk2017381_ci.pdf#@#@2.7314186096191406#@#@pdf#@#@c:\users\ichemiakin001\desktop\???????????? ???????? ?? ????????????? ?????? ???????? ??????????? test cost of sales transactions - trade entity\??????? ???????\??\#@#@c:\users\ichemiakin001\desktop\???????????? ???????? ?? ????????????? ?????? ???????? ??????????? test cost of sales transactions - trade entity\??????? ???????\??\20_xiamen wingtas_wk2017381_ci.pdf#@#@g:\assurance\clients\mm\sportmaster group\2017\sportmaster ifrs audit\office file\???????????? ???????? ?? ????????????? ?????? ???????? ??????????? test cost of sales transactions - trade entity\??????? ???????\??\#@#@g:\assurance\clients\mm\sportmaster group\2017\sportmaster ifrs audit\office file\???????????? ???????? ?? ????????????? ?????? ???????? ??????????? test cost of sales transactions - trade entity\??????? ???????\??\#@#@False#@#@False#@#@explorer.exe#@#@Operation monitored, File not saved"
| rex "#@#@(?&amp;lt;value&amp;gt;[^#]+)" max_match=15
| eval etype=mvindex(value,0),CountryCode=mvindex(value,1),ComputerName=mvindex(value,2),Operation=mvindex(value,3),Source_File=mvindex(value,4),Detail_File_Size_MB=mvindex(value,5),Source_File_Extension=mvindex(value,6),Source_Directory=mvindex(value,7),Destination_Directory=mvindex(value,8),destination=mvindex(value,9),someOtherDirectory=mvindex(value,10),Was_Blocked=mvindex(value,11),Was_File_Captured=mvindex(value,12),Application=mvindex(value,13),action=mvindex(value,14)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please try out and confirm.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:21:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-expression-to-split-a-string-into-multiple-strings-based/m-p/365329#M107754</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-29T17:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression to split a string into multiple strings based on a delimiter.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression-to-split-a-string-into-multiple-strings-based/m-p/365330#M107755</link>
      <description>&lt;P&gt;hey &lt;/P&gt;

&lt;P&gt;you can do this with UI as well!!&lt;BR /&gt;
go to &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;settings&amp;gt;fields&amp;gt;field extractions&amp;gt;select sourcetype&amp;gt;next&amp;gt;delimiters&amp;gt;other and then put custom delimiter "#@#@"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this will change props.conf &lt;/P&gt;

&lt;P&gt;You can also change this in props.conf. The documentation says:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;FIELD_DELIMITER = 
Tells Splunk which character delimits or separates fields in the
specified file or source.
This attribute supports the use of the special characters described
above.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know if this helps!&lt;/P&gt;</description>
      <pubDate>Sun, 24 Dec 2017 04:59:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-expression-to-split-a-string-into-multiple-strings-based/m-p/365330#M107755</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2017-12-24T04:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression to split a string into multiple strings based on a delimiter.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression-to-split-a-string-into-multiple-strings-based/m-p/365331#M107756</link>
      <description>&lt;P&gt;@mayurr98, delimiter can only be single character. So first hash &lt;CODE&gt;#&lt;/CODE&gt; character will be used as delimiter.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Dec 2017 05:35:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-expression-to-split-a-string-into-multiple-strings-based/m-p/365331#M107756</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-12-24T05:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression to split a string into multiple strings based on a delimiter.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression-to-split-a-string-into-multiple-strings-based/m-p/365332#M107757</link>
      <description>&lt;P&gt;yes but still you will be able to extract all the fields you want just that there will unnecessary 3 fields with empty values created after every 1 field if you are fine with it.You will be able to get what you want for 100% as I have tried this in test env.&lt;/P&gt;

&lt;P&gt;field1 12/23/2017 12:37:06 PM&lt;BR /&gt;
field2&lt;BR /&gt;
field3&lt;BR /&gt;
field4&lt;BR /&gt;
field5 Copying to removable media&lt;BR /&gt;&lt;BR /&gt;
and so on &lt;/P&gt;

&lt;P&gt;In this case, you can rename the field you want.empty fields will get extracted but then you need not use it for further analysis&lt;/P&gt;</description>
      <pubDate>Sun, 24 Dec 2017 06:06:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-expression-to-split-a-string-into-multiple-strings-based/m-p/365332#M107757</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2017-12-24T06:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression to split a string into multiple strings based on a delimiter.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression-to-split-a-string-into-multiple-strings-based/m-p/365333#M107758</link>
      <description>&lt;P&gt;Let's see what @rajim wants to try. However there will be 45 unwanted fields extracted during search time field discovery, which is just an overhead.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Dec 2017 09:06:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-expression-to-split-a-string-into-multiple-strings-based/m-p/365333#M107758</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-12-24T09:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression to split a string into multiple strings based on a delimiter.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-expression-to-split-a-string-into-multiple-strings-based/m-p/365334#M107759</link>
      <description>&lt;P&gt;@rajim, were you able to try out any of the following answers? Is your issue resolved?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 04:30:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-expression-to-split-a-string-into-multiple-strings-based/m-p/365334#M107759</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-12-29T04:30:30Z</dc:date>
    </item>
  </channel>
</rss>

