<?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 rex for http2 field in log in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/rex-for-http2-field-in-log/m-p/582836#M202973</link>
    <description>&lt;P&gt;In the following log entry as "_raw":&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;"OPTIONS /nnrf-nfm/v1 HTTP/2.0" 405 173 "-" "gmlc-http-client/2.0" "-"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have successful rex for the "405" error field location and "173" error field location.&lt;/P&gt;&lt;P&gt;I would like to build a rex to identify the "gmlc-http-client" section of that log entry.&amp;nbsp; (That field can show several different client types between those quotes.)&lt;/P&gt;&lt;P&gt;My rex is as follows:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;rex field=_raw "HTTP\/2\.0\"\s\d{3}\s\d{3}\s\"\-\"\s\"(?&amp;lt;Error3&amp;gt;)\"\s\"\-\""&lt;/P&gt;&lt;P&gt;This rex does not error, but the result comes back as null/blank.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jan 2022 22:15:39 GMT</pubDate>
    <dc:creator>he204035</dc:creator>
    <dc:date>2022-01-27T22:15:39Z</dc:date>
    <item>
      <title>rex for http2 field in log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-for-http2-field-in-log/m-p/582836#M202973</link>
      <description>&lt;P&gt;In the following log entry as "_raw":&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;"OPTIONS /nnrf-nfm/v1 HTTP/2.0" 405 173 "-" "gmlc-http-client/2.0" "-"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have successful rex for the "405" error field location and "173" error field location.&lt;/P&gt;&lt;P&gt;I would like to build a rex to identify the "gmlc-http-client" section of that log entry.&amp;nbsp; (That field can show several different client types between those quotes.)&lt;/P&gt;&lt;P&gt;My rex is as follows:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;rex field=_raw "HTTP\/2\.0\"\s\d{3}\s\d{3}\s\"\-\"\s\"(?&amp;lt;Error3&amp;gt;)\"\s\"\-\""&lt;/P&gt;&lt;P&gt;This rex does not error, but the result comes back as null/blank.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 22:15:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-for-http2-field-in-log/m-p/582836#M202973</guid>
      <dc:creator>he204035</dc:creator>
      <dc:date>2022-01-27T22:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: rex for http2 field in log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-for-http2-field-in-log/m-p/582844#M202978</link>
      <description>&lt;P&gt;Try these. One is greedier than the other.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=_raw "\"OPTIONS([^\"]*)?HTTP\/\d\.\d\"\s\d+\s\d+\s[^\s]*\s\"(?&amp;lt;http_client&amp;gt;[^\"]*)"

| rex field=_raw "HTTP\/\d\.\d\"\s\d+\s\d+\s[^\s]*\s\"(?&amp;lt;http_client&amp;gt;[^\"]*)"&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 28 Jan 2022 01:44:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-for-http2-field-in-log/m-p/582844#M202978</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2022-01-28T01:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: rex for http2 field in log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-for-http2-field-in-log/m-p/582915#M202991</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;rex field=_raw "HTTP\/2\.0\"\s\d{3}\s\d{3}\s\"\-\"\s\"(?&amp;lt;Error3&amp;gt;)\"\s\"\-\""&lt;P&gt;This rex does not error, but the result comes back as null/blank.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The expression "&lt;U&gt;&lt;FONT face="courier new,courier"&gt;(?&amp;lt;Error3&amp;gt;)&lt;/FONT&gt;&lt;/U&gt;" positively looks for zero-length match, hence zero-length Error3. &amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/190794"&gt;@johnhuang&lt;/a&gt;'s suggestion of&amp;nbsp;&lt;U&gt;&lt;FONT face="courier new,courier"&gt;(?&amp;lt;Error3&amp;gt;[^\"]+)&lt;/FONT&gt;&lt;/U&gt; will fix this. &amp;nbsp;Overall, the above is too rigid. &amp;nbsp;Although httpd logs are highly standard, it is not safe to assume that a blank field (&lt;U&gt;&lt;FONT face="courier new,courier"&gt;"-"&lt;/FONT&gt;&lt;/U&gt;) will always be blank, for example. &amp;nbsp;Expressions like &lt;U&gt;&lt;FONT face="courier new,courier"&gt;[^\"]+&lt;/FONT&gt;&lt;/U&gt; are good lubricants for this purpose.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 11:15:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-for-http2-field-in-log/m-p/582915#M202991</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-01-28T11:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: rex for http2 field in log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-for-http2-field-in-log/m-p/582925#M202994</link>
      <description>&lt;P&gt;The second suggestion did the trick.&amp;nbsp; Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 13:52:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-for-http2-field-in-log/m-p/582925#M202994</guid>
      <dc:creator>he204035</dc:creator>
      <dc:date>2022-01-28T13:52:55Z</dc:date>
    </item>
  </channel>
</rss>

