<?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 in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Regular-Expression/m-p/707566#M10359</link>
    <description>&lt;P&gt;According to regex101.com, your regular expression works.&amp;nbsp; This one, however, is more efficient.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EXTRACT-Rule = (")?Rule:(?P&amp;lt;Rule&amp;gt;.*?)(?(1)\1|,)&lt;/LI-CODE&gt;&lt;P&gt;It looks for a leading quotation mark and uses that as the terminating character (using &lt;FONT face="courier new,courier"&gt;(?(1)\1|,)&lt;/FONT&gt;).&lt;/P&gt;</description>
    <pubDate>Thu, 26 Dec 2024 01:21:28 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2024-12-26T01:21:28Z</dc:date>
    <item>
      <title>Regular Expression</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Regular-Expression/m-p/707564#M10358</link>
      <description>&lt;P&gt;I need to extract the Rule field using a regex in props.conf without using transforms.conf.&lt;/P&gt;
&lt;P&gt;The regex I used was&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Rule\:(?P&amp;lt;Rule&amp;gt;\s.*?(?=\")|((\s\w+)+)\-\w+\s\w+|\s.*?(?=\,))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Please let me know if you have any idea of ​​regular expression that satisfies all cases below to extract rule field by looking at the original data below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;Test-String

Dec 5 17:22:59 10.2.1.166 Dec 5 17:13:45 ICxxx SymantecServer: Nxxx,10.150.35.108,Continue,Application and Device Control is ready,System,Begin: 2022-12-05 17:13:18,End Time: 2022-12-05 17:13:18,Rule: Built-in rule,0,SysPlant,0,SysPlant,None,User Name: None,Domain Name: None,Action Type: ,File size (bytes): 0,Device ID:

Dec 5 17:22:59 10.2.1.166 Dec 5 17:12:45 ICxxx SymantecServer,10.10.232.76,Blocked,[AC7-2.1] 스크립트 차단 - Caller,End Time: 2024-12-05 16:41:09,Rule: 모든 응용 프로그램 | [AC7-2.1] 파일 및 폴더 액세스 시도,9056,C:/Windows/System32/svchost.exe,0,No Module Name,C:/Windows/System32/GroupPolicy/DataStore/0/SysVol/celltrion.com/Policies/{08716B68-6FB2-4C06-99B3-2685F9035E2E}/Machine/Scripts/Startup/start_dot3svc.bat,User Name: xxx,Domain Name: xxx,Action Type: ,File size (bytes): xx,Device ID: xxx\xx&amp;amp;Ven_NVMe&amp;amp;Prod_Skhynix_BC501_NV\5&amp;amp;974&amp;amp;0&amp;amp;000

Dec 5 17:22:59 10.2.1.166 Dec 5 17:13:06 IC01 SymantecServer: N1404002,10.50.248.13,Blocked,이 규칙은 모든 응용 프로그램이 시스템에 드라이브 문자를 추가하는 모든 USB 장치에 파일을 쓸 수 없도록 차단합니다. - File,Begin: 2024-12-05 16:33:53,End Time: 2024-12-05 16:33:53,"Rule: USB 드라이브에 읽기 허용,쓰기 차단 | [AC4-1.1] USB 드라이브에 읽기 허용,쓰기 차단",4032,C:/Program Files/Microsoft Office/xxx/Office16/EXCEL.EXE,0,No Module Name,D:/1. NBD/1. ADC cytotoxicity/2024-4Q/~$20241203-05 CT-P70 Drug release.xlsx,User Name: 1404002,Domain Name:xxx,Action Type: ,File size (bytes): 0,xx&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;extract string

Rule: Built-in rule 
Rule: 모든 응용 프로그램 | [AC7-2.1] 파일 및 폴더 액세스 시도
Rule: USB 드라이브에 읽기 허용,쓰기 차단 | [AC4-1.1] USB 드라이브에 읽기 허용,쓰기 차단&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2024 15:07:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Regular-Expression/m-p/707564#M10358</guid>
      <dc:creator>silverKi</dc:creator>
      <dc:date>2024-12-27T15:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Regular Expression</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Regular-Expression/m-p/707566#M10359</link>
      <description>&lt;P&gt;According to regex101.com, your regular expression works.&amp;nbsp; This one, however, is more efficient.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EXTRACT-Rule = (")?Rule:(?P&amp;lt;Rule&amp;gt;.*?)(?(1)\1|,)&lt;/LI-CODE&gt;&lt;P&gt;It looks for a leading quotation mark and uses that as the terminating character (using &lt;FONT face="courier new,courier"&gt;(?(1)\1|,)&lt;/FONT&gt;).&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2024 01:21:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Regular-Expression/m-p/707566#M10359</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-12-26T01:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: Regular Expression</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Regular-Expression/m-p/707569#M10361</link>
      <description>&lt;P&gt;Can you explain the regular expression you used?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2024 04:56:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Regular-Expression/m-p/707569#M10361</guid>
      <dc:creator>silverKi</dc:creator>
      <dc:date>2024-12-26T04:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Regular Expression</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Regular-Expression/m-p/707572#M10363</link>
      <description>&lt;P&gt;Try this expression&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;("|)Rule:\s*(?P&amp;lt;Rule&amp;gt;.*?)\1,\d&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 26 Dec 2024 10:12:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Regular-Expression/m-p/707572#M10363</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-12-26T10:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: Regular Expression</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Regular-Expression/m-p/707603#M10365</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Can you try the following regex&lt;BR /&gt;&lt;BR /&gt;Regex:&amp;nbsp;&lt;STRONG&gt;Rule:\s(?P&amp;lt;Rule&amp;gt;(.*?)(?=,\d+))&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;It uses positive lookahead (?=) and captures everything until it finds "," followed by digit. If the end of the rule always has a digit then this will work. Keep in mind that if an word is replaced by digit at the end of the rule this will not work.&lt;BR /&gt;&lt;BR /&gt;Please try and if it works an upvote is appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2024 06:37:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Regular-Expression/m-p/707603#M10365</guid>
      <dc:creator>Aditi27</dc:creator>
      <dc:date>2024-12-27T06:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Regular Expression</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Regular-Expression/m-p/707623#M10366</link>
      <description>&lt;P&gt;Positive lookahead doesn't perform well in Splunk and, generally, is unnecessary.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2024 12:49:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Regular-Expression/m-p/707623#M10366</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-12-27T12:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Regular Expression</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Regular-Expression/m-p/709204#M10368</link>
      <description>&lt;P&gt;I solved the problem using REX&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(\"|)Rule:\s*(?P&amp;lt;Rule&amp;gt;.*?)(?:(\"))?\&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 07:51:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Regular-Expression/m-p/709204#M10368</guid>
      <dc:creator>silverKi</dc:creator>
      <dc:date>2025-01-20T07:51:49Z</dc:date>
    </item>
  </channel>
</rss>

