<?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: Rex, extract 2 values into one variable in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Rex-extract-2-values-into-one-variable/m-p/202144#M58605</link>
    <description>&lt;P&gt;that last part should read (without the spaces)&lt;/P&gt;

&lt;P&gt;rex "GET\s+(?&amp;lt; status &amp;gt;\d+) POST\s+(?&amp;lt; status &amp;gt;\d+)"|chart count by status&lt;/P&gt;</description>
    <pubDate>Mon, 01 Aug 2016 21:04:03 GMT</pubDate>
    <dc:creator>dbcase</dc:creator>
    <dc:date>2016-08-01T21:04:03Z</dc:date>
    <item>
      <title>Rex, extract 2 values into one variable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-extract-2-values-into-one-variable/m-p/202143#M58604</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have data that looks like this&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;"beta.icontrol.com" 173.3.202.209 "173.3.202.209" - - [01/Aug/2016:15:50:59 -0500] "GET /rest/icontrol/logout/ HTTP/1.1" 200 - 0 "-" "Mozilla/5.0 (Linux; Android 6.0.1; SAMSUNG-SM-N920A Build/MMB29K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/52.0.2743.91 Mobile Safari/537.36" "-"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;"beta.icontrol.com" 75.27.138.54 "75.27.138.54" - - [01/Aug/2016:15:52:12 -0500] "POST /rest/icontrol/sites/1000262/network/instances/14001e5e090204731d.9.0/points/coolSetPoint?value=2056 HTTP/1.1" 202 7 0 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_3 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13G34"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I'm attempting to count the number of GETs and POSTs.  Something like this (but it doesn't work because I'm brand new to rex)&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=main  source="/etc/httpd/logs/&lt;EM&gt;-access_log&lt;/EM&gt;"  |rex "GET\s+(?\d+) POST\s+(?\d+)"|chart count by status&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Splunk complains about two things having the same name (status).  Just not sure how to go about this the right way....&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:27:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-extract-2-values-into-one-variable/m-p/202143#M58604</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2020-09-29T10:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Rex, extract 2 values into one variable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-extract-2-values-into-one-variable/m-p/202144#M58605</link>
      <description>&lt;P&gt;that last part should read (without the spaces)&lt;/P&gt;

&lt;P&gt;rex "GET\s+(?&amp;lt; status &amp;gt;\d+) POST\s+(?&amp;lt; status &amp;gt;\d+)"|chart count by status&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2016 21:04:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-extract-2-values-into-one-variable/m-p/202144#M58605</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2016-08-01T21:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: Rex, extract 2 values into one variable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-extract-2-values-into-one-variable/m-p/202145#M58606</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "(?&amp;lt;status&amp;gt;GET|POST)" | stats count by status
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Aug 2016 21:07:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-extract-2-values-into-one-variable/m-p/202145#M58606</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-01T21:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: Rex, extract 2 values into one variable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-extract-2-values-into-one-variable/m-p/202146#M58607</link>
      <description>&lt;P&gt;Found it (thanks to another post)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main  source="/etc/httpd/logs/*-access_log*"  |rex "GET\s|POST\s+(?&amp;lt; status &amp;gt;\d+)"|chart count by status
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Aug 2016 21:09:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-extract-2-values-into-one-variable/m-p/202146#M58607</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2016-08-01T21:09:13Z</dc:date>
    </item>
  </channel>
</rss>

