<?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: regex help in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/542045#M153533</link>
    <description>&lt;P&gt;I'm reading a log file. this is a single event:&lt;/P&gt;&lt;P&gt;02-Mar-2021 UDP Response Status:Found Response Type:ABC &lt;A href="http://www.site1.com" target="_blank"&gt;www.site1.com&lt;/A&gt; 404 &lt;A href="http://www.site10.com" target="_blank"&gt;www.site10.com&lt;/A&gt; 100 &lt;A href="http://www.site4.com" target="_blank"&gt;www.site4.com&lt;/A&gt; 400&lt;/P&gt;&lt;P&gt;I'd like to create a regex/field extraction that captures all the fields below. website would be a multivalue field since there are multiple occurrences (one to many)&lt;/P&gt;&lt;P&gt;fields and values&lt;BR /&gt;date:02-Mar-2021&lt;BR /&gt;protocol: UDP&lt;BR /&gt;Response status: Found&lt;BR /&gt;Response Type: ABC&lt;BR /&gt;website: &lt;A href="http://www.site1.com" target="_blank"&gt;www.site1.com&lt;/A&gt;&lt;BR /&gt;status: 404&lt;BR /&gt;website: &lt;A href="http://www.site10.com" target="_blank"&gt;www.site10.com&lt;/A&gt;&lt;BR /&gt;status: 100&lt;BR /&gt;website: &lt;A href="http://www.site4.com" target="_blank"&gt;www.site4.com&lt;/A&gt;&lt;BR /&gt;status: 400&lt;/P&gt;</description>
    <pubDate>Tue, 02 Mar 2021 20:36:30 GMT</pubDate>
    <dc:creator>pc1234</dc:creator>
    <dc:date>2021-03-02T20:36:30Z</dc:date>
    <item>
      <title>regex help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/542030#M153523</link>
      <description>&lt;P&gt;Can someone assist extracting fields using the string below?&lt;/P&gt;&lt;P&gt;The first line is header info: date, protocol, response_status, response_type&lt;/P&gt;&lt;P&gt;each line following (one to many) is a website and an error code&lt;/P&gt;&lt;P&gt;i can't figure out a regex to capture the header line AND the successive lines of websites and error codes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;02-Mar-2021 UDP Response Found Response Type: ABC&lt;BR /&gt;&lt;A href="http://www.site1.com" target="_blank" rel="noopener"&gt;www.site1.com&lt;/A&gt; 404&lt;BR /&gt;&lt;A href="http://www.site10.com" target="_blank" rel="noopener"&gt;www.site10.com&lt;/A&gt; 100&lt;BR /&gt;&lt;A href="http://www.site4.com" target="_blank" rel="noopener"&gt;www.site4.com&lt;/A&gt; 400&lt;BR /&gt;.....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in Advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Mar 2021 19:38:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/542030#M153523</guid>
      <dc:creator>pc1234</dc:creator>
      <dc:date>2021-03-02T19:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: regex help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/542039#M153529</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/144424"&gt;@pc1234&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand:&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;have you a log or a csv file?&lt;/LI&gt;&lt;LI&gt;then I don't understan the structure of the file:&lt;UL&gt;&lt;LI&gt;have you an header containing infos and each row is an event?&lt;/LI&gt;&lt;LI&gt;the event is the full file (headet + rows)?&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Then do you want only one regex or is it acceptable for you to use two regexes?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 02 Mar 2021 20:20:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/542039#M153529</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-03-02T20:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: regex help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/542045#M153533</link>
      <description>&lt;P&gt;I'm reading a log file. this is a single event:&lt;/P&gt;&lt;P&gt;02-Mar-2021 UDP Response Status:Found Response Type:ABC &lt;A href="http://www.site1.com" target="_blank"&gt;www.site1.com&lt;/A&gt; 404 &lt;A href="http://www.site10.com" target="_blank"&gt;www.site10.com&lt;/A&gt; 100 &lt;A href="http://www.site4.com" target="_blank"&gt;www.site4.com&lt;/A&gt; 400&lt;/P&gt;&lt;P&gt;I'd like to create a regex/field extraction that captures all the fields below. website would be a multivalue field since there are multiple occurrences (one to many)&lt;/P&gt;&lt;P&gt;fields and values&lt;BR /&gt;date:02-Mar-2021&lt;BR /&gt;protocol: UDP&lt;BR /&gt;Response status: Found&lt;BR /&gt;Response Type: ABC&lt;BR /&gt;website: &lt;A href="http://www.site1.com" target="_blank"&gt;www.site1.com&lt;/A&gt;&lt;BR /&gt;status: 404&lt;BR /&gt;website: &lt;A href="http://www.site10.com" target="_blank"&gt;www.site10.com&lt;/A&gt;&lt;BR /&gt;status: 100&lt;BR /&gt;website: &lt;A href="http://www.site4.com" target="_blank"&gt;www.site4.com&lt;/A&gt;&lt;BR /&gt;status: 400&lt;/P&gt;</description>
      <pubDate>Tue, 02 Mar 2021 20:36:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/542045#M153533</guid>
      <dc:creator>pc1234</dc:creator>
      <dc:date>2021-03-02T20:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: regex help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/542083#M153543</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/144424"&gt;@pc1234&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you have to use two regexes:&lt;/P&gt;&lt;P&gt;the first to extract the header:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "^(?&amp;lt;date&amp;gt;[^ ]+)\s+(?&amp;lt;protocol&amp;gt;\w+)\sResponse\s+(?&amp;lt;response_status&amp;gt;\w+).+Response\s+Type:\s+(?&amp;lt;response_type&amp;gt;\w+)"&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/wP3LyX/1" target="_blank"&gt;https://regex101.com/r/wP3LyX/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;the second to extract the sites:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "(?&amp;lt;site&amp;gt;www\.[^ ]+)\s+(?&amp;lt;response_code&amp;gt;\d+)"&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/UCwx2h/1" target="_blank"&gt;https://regex101.com/r/UCwx2h/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 07:30:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-help/m-p/542083#M153543</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-03-03T07:30:34Z</dc:date>
    </item>
  </channel>
</rss>

