<?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: What will be the Regex for creating the below alert? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381907#M111659</link>
    <description>&lt;P&gt;thanks @DalJeanis, this works, but wanted to know why this was required. I have used regex previously for other patterns but never required this&lt;/P&gt;</description>
    <pubDate>Fri, 03 Aug 2018 14:07:14 GMT</pubDate>
    <dc:creator>abhi04</dc:creator>
    <dc:date>2018-08-03T14:07:14Z</dc:date>
    <item>
      <title>What will be the Regex for creating the below alert?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381896#M111648</link>
      <description>&lt;P&gt;I have below two events which I hav separated by "=" line for better view.I want to extract the below mentioned lines by Server Name "USPLZ1MVPFP001.NAO.GLOBAL.GMACFS.COM" :&lt;/P&gt;

&lt;P&gt;S:/PCTOOLS/085/CommLend/Comments/ad_hoc.ldb &lt;BR /&gt;
S:/PCTOOLS/085/CommLend/Comments/romcomm.ldb &lt;BR /&gt;
S:/PCTOOLS/005/CommLend/Comments/romcomm.ldb &lt;BR /&gt;
S:/PCTOOLS/061/CommLend/Comments/romcomm.ldb &lt;BR /&gt;
S:/PCTOOLS/084/CommLend/Comments/romcomm.ldb&lt;/P&gt;

&lt;P&gt;7/31/18&lt;BR /&gt;
8:15:01.000 PM&lt;BR /&gt;&lt;BR /&gt;
S:/PCTOOLS/085/CommLend/Comments/ad_hoc.ldb&lt;BR /&gt;
S:/PCTOOLS/085/CommLend/Comments/romcomm.ldb&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;Script Information:&lt;BR /&gt;
Script LdbFileCheckerWE run on Admin Server: SAT1MVMAP263 and creates log at location:D:/PCTOOL/Logs/LDB/LdbFileLogsWE.txt&lt;BR /&gt;
host =  SAT1MVMAP263 source =   D:\PCTOOL\Logs\LDB\LdbFileLogsWE.txt sourcetype =   auto_preprod_ldb_log&lt;/P&gt;

&lt;P&gt;===============================================================================================&lt;/P&gt;

&lt;P&gt;7/31/18&lt;BR /&gt;
8:15:00.000 PM&lt;BR /&gt;&lt;BR /&gt;
2018/07/31 19:15:00&lt;BR /&gt;
Hello Ally\x96Hosting Windows Team, &lt;BR /&gt;
Kindly refer below path,Server details and close below open user sessions:&lt;BR /&gt;
Server Name: USPLZ1MVPFP001.NAO.GLOBAL.GMACFS.COM&lt;BR /&gt;
S:/PCTOOLS/005/CommLend/Comments/romcomm.ldb&lt;BR /&gt;
S:/PCTOOLS/061/CommLend/Comments/romcomm.ldb&lt;BR /&gt;
S:/PCTOOLS/084/CommLend/Comments/romcomm.ldb&lt;/P&gt;

&lt;P&gt;How to do this?&lt;/P&gt;

&lt;P&gt;I have used the below regex but it extracts only two:&lt;/P&gt;

&lt;P&gt;rex field=_raw "(?&amp;lt;&amp;gt;S:\/.*)"&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:42:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381896#M111648</guid>
      <dc:creator>abhi04</dc:creator>
      <dc:date>2020-09-29T20:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: What will be the Regex for creating the below alert?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381897#M111649</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Can you please explain more about this &lt;STRONG&gt;"I want to extract the below mentioned lines by Server Name "USPLZ1MVPFP001.NAO.GLOBAL.GMACFS.COM" :"&lt;/STRONG&gt; &lt;BR /&gt;
Also, there is no name for your name-capturing group in rex. Try this, &lt;CODE&gt;rex field=_raw "^(?&amp;lt;put_some_fieldname&amp;gt;S:\/.*)"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 11:57:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381897#M111649</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-08-01T11:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: What will be the Regex for creating the below alert?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381898#M111650</link>
      <description>&lt;P&gt;Hi  abhi04,&lt;BR /&gt;
you could try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?&amp;lt;file&amp;gt;\w:\/[^ ]*\.ldb)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;that you can test at &lt;A href="https://regex101.com/r/quFBpb/1"&gt;https://regex101.com/r/quFBpb/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 12:06:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381898#M111650</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2018-08-01T12:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: What will be the Regex for creating the below alert?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381899#M111651</link>
      <description>&lt;P&gt;This is not working&lt;BR /&gt;
@cusello&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 08:17:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381899#M111651</guid>
      <dc:creator>abhi04</dc:creator>
      <dc:date>2018-08-02T08:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: What will be the Regex for creating the below alert?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381900#M111652</link>
      <description>&lt;P&gt;@nittala_surya, when I am adding the name _capture it wont show here, so you can assume any name in the &amp;lt;&amp;gt; .&lt;BR /&gt;
Also the regex quoted by you does not work.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 08:18:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381900#M111652</guid>
      <dc:creator>abhi04</dc:creator>
      <dc:date>2018-08-02T08:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: What will be the Regex for creating the below alert?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381901#M111653</link>
      <description>&lt;P&gt;@abhi04, Firstly, I used the same regex (with ) you gave and it worked fine against your sample data. Did you check for the field under "Interesting Fields" section?&lt;BR /&gt;
Secondly, you did not answer my question above. What do you mean by this &lt;STRONG&gt;"I want to extract the below mentioned lines by Server Name "USPLZ1MVPFP001.NAO.GLOBAL.GMACFS.COM" :"&lt;/STRONG&gt; Do you want to extract the lines if event has "Server Name" only?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 11:56:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381901#M111653</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-08-02T11:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: What will be the Regex for creating the below alert?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381902#M111654</link>
      <description>&lt;P&gt;You ignore the comment ""I want to extract the below mentioned lines by Server Name "USPLZ1MVPFP001.NAO.GLOBAL.GMACFS.COM" :".&lt;/P&gt;

&lt;P&gt;I want to extract the lines with Server Name mentioned or not.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 12:04:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381902#M111654</guid>
      <dc:creator>abhi04</dc:creator>
      <dc:date>2018-08-02T12:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: What will be the Regex for creating the below alert?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381903#M111655</link>
      <description>&lt;P&gt;In that case the regex should definitely work! Please go to &lt;A href="https://regex101.com/r/s96xpm/1"&gt;https://regex101.com/r/s96xpm/1&lt;/A&gt; to validate regex against your sample. &lt;BR /&gt;
And, I am still unsure of what your question is. Because, you have a working regex in your initial question. Can you explain where you're facing trouble?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 12:26:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381903#M111655</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-08-02T12:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: What will be the Regex for creating the below alert?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381904#M111656</link>
      <description>&lt;P&gt;I believe you just need to add &lt;CODE&gt;max_match=0&lt;/CODE&gt; to your &lt;CODE&gt;| rex&lt;/CODE&gt; line, so that multiple copies of the regex match can occur in a single event.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 14:47:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381904#M111656</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-08-02T14:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: What will be the Regex for creating the below alert?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381905#M111657</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Can you please try using the below, this will give you the count of that keyword appear in logs.&lt;/P&gt;

&lt;P&gt;| rex field=_raw "(?i)\W(?PUSPLZ1MVPFP001.NAO.GLOBAL.GMACFS.COM)\W" | rename general_exception_type as Exception-Type| stats count by host, source,sourcetype, Exception-Type&lt;/P&gt;

&lt;P&gt;Please try do let us know if that works.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:43:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381905#M111657</guid>
      <dc:creator>wanip</dc:creator>
      <dc:date>2020-09-29T20:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: What will be the Regex for creating the below alert?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381906#M111658</link>
      <description>&lt;P&gt;@nittala_surya - Yes, the regex is working fine when I tested in  &lt;A href="https://regex101.com/r/s96xpm/1"&gt;https://regex101.com/r/s96xpm/1&lt;/A&gt; but wont extract all the lines in Splunk.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 12:56:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381906#M111658</guid>
      <dc:creator>abhi04</dc:creator>
      <dc:date>2018-08-03T12:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: What will be the Regex for creating the below alert?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381907#M111659</link>
      <description>&lt;P&gt;thanks @DalJeanis, this works, but wanted to know why this was required. I have used regex previously for other patterns but never required this&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 14:07:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381907#M111659</guid>
      <dc:creator>abhi04</dc:creator>
      <dc:date>2018-08-03T14:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: What will be the Regex for creating the below alert?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381908#M111660</link>
      <description>&lt;P&gt;@abhi04 - if a pattern is to match once, that parameter is not required.  However, to use the same match multiple times in the same event, that parameter must be present.  The other times that you didn't need it were probably because you were matching patterns that only mattered once.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Aug 2018 01:50:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-will-be-the-Regex-for-creating-the-below-alert/m-p/381908#M111660</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-08-04T01:50:30Z</dc:date>
    </item>
  </channel>
</rss>

