<?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: Extract multiple hostname from one regex search in globalprotect logs in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-multiple-hostname-from-one-regex-search-in/m-p/531721#M150187</link>
    <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; command requires the regex be enclosed in quotation marks.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Dec 2020 15:25:20 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-12-02T15:25:20Z</dc:date>
    <item>
      <title>How to extract multiple hostname from one regex search in globalprotect logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-multiple-hostname-from-one-regex-search-in/m-p/531343#M150093</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;I'm trying to create a simple list with all the devices found on the logs from globalprotect. The deal is, i'm using rex to match it with regular expressions.&amp;nbsp; I've already used&amp;nbsp; regex101.com to double check my search but, when I run it on splunk it fails.&lt;/P&gt;
&lt;P&gt;My search:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index="ind_Aaaabbbb" log_subtype="globalprotect" globalprotectgateway-config-succ OR globalprotectgateway-logout-succ
| rex field=_raw (?&amp;lt;device&amp;gt;\w\w\w\w\w\w\s\w\w\w\w:\s+(?:\w+\-\w+\-\w+|\w+))
| table _time, user, event_id, src_ip, device, dvc_name, dvc&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The ideal expresions to capture:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Device name: DDD-AAA-BBBBB&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Device name: DDDAAABBBBBBB&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Error returned by Splunk:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Error in 'SearchParser': Missing a search command before '\'. Error at position '198' of search query 'search index="index" log_subtype="globalpro...{snipped} {errorcontext = -\w+\-\w+|\w+)) | tab}'.&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Example data:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SYSTEM,globalprotect,0,2020/11/29,,globalprotectgateway-config-succ,Gateway-XXX-XX-XXX-N,0,0,general,informational,"GlobalProtect gateway client configuration generated. username.5, Private IP: 00.000.000.00, Client version: 5.1.1-12, Device name: DDD-AAA-BBBBB, Client OS version: Microsoft Windows 10 Pro , 64-bit, VPN type: Device Level VPN.",000...,0x0,0,0,0,0,,FW-PA-0000-AAA-CCC-TTTT

SYSTEM,globalprotect,0,2020/11/29 ,,globalprotectgateway-config-succ,Gateway-XXX-XX-N,0,0,general,informational,"GlobalProtect gateway client configuration generated. username.5, Private IP: 00.000.000.000, Client version: 5.1.5-20, Device name: DDDAAABBBBBBB, Client OS version: Microsoft Windows 10 Pro , 64-bit, VPN type: Device Level VPN.",000...,0x0,0,0,0,0,,FW-PA-0000-AAA-CCC-TTTT&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 04:25:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-multiple-hostname-from-one-regex-search-in/m-p/531343#M150093</guid>
      <dc:creator>briansarmiento</dc:creator>
      <dc:date>2020-12-02T04:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple hostname from one regex search in globalprotect logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-multiple-hostname-from-one-regex-search-in/m-p/531369#M150096</link>
      <description>&lt;P&gt;I suspect rex doesn't like the embedded pipe character.&amp;nbsp; Try this query that not only doesn't use a pipe, it's also tons more efficient (51 steps vs. 3250).&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(?&amp;lt;device&amp;gt;Device name:\s+\w{3}-?\w{3}-?\w{5,7})&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 30 Nov 2020 17:44:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-multiple-hostname-from-one-regex-search-in/m-p/531369#M150096</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-11-30T17:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple hostname from one regex search in globalprotect logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-multiple-hostname-from-one-regex-search-in/m-p/531605#M150143</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp; unfortunately that search didn't help, It stills returning an error. This time its the following&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Error in 'rex' command: Encountered the following error while compiling the regex '(?&amp;lt;device&amp;gt;Device': Regex: missing closing parenthesis.&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 21:47:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-multiple-hostname-from-one-regex-search-in/m-p/531605#M150143</guid>
      <dc:creator>briansarmiento</dc:creator>
      <dc:date>2020-12-01T21:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple hostname from one regex search in globalprotect logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-multiple-hostname-from-one-regex-search-in/m-p/531698#M150177</link>
      <description>&lt;P&gt;No such error here.&amp;nbsp; Please share your full query.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="richgalloway_0-1606917443201.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/12163iC74D47D76320D697/image-size/medium?v=v2&amp;amp;px=400" role="button" title="richgalloway_0-1606917443201.png" alt="richgalloway_0-1606917443201.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 13:57:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-multiple-hostname-from-one-regex-search-in/m-p/531698#M150177</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-12-02T13:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple hostname from one regex search in globalprotect logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-multiple-hostname-from-one-regex-search-in/m-p/531705#M150179</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;BR /&gt;here is my full query.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="briansarmiento_0-1606917640972.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/12164iFAAF3F9FEAE374ED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="briansarmiento_0-1606917640972.png" alt="briansarmiento_0-1606917640972.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance for your Help.! (Y)&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 14:01:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-multiple-hostname-from-one-regex-search-in/m-p/531705#M150179</guid>
      <dc:creator>briansarmiento</dc:creator>
      <dc:date>2020-12-02T14:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple hostname from one regex search in globalprotect logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-multiple-hostname-from-one-regex-search-in/m-p/531721#M150187</link>
      <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; command requires the regex be enclosed in quotation marks.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 15:25:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-multiple-hostname-from-one-regex-search-in/m-p/531721#M150187</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-12-02T15:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple hostname from one regex search in globalprotect logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-multiple-hostname-from-one-regex-search-in/m-p/531728#M150189</link>
      <description>&lt;P class="lia-indent-padding-left-30px"&gt;Perfect, it totally worked. Thank you very much!&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 15:58:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-multiple-hostname-from-one-regex-search-in/m-p/531728#M150189</guid>
      <dc:creator>briansarmiento</dc:creator>
      <dc:date>2020-12-02T15:58:02Z</dc:date>
    </item>
  </channel>
</rss>

