<?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: How to pull one variable with multiple changing values? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-pull-one-variable-with-multiple-changing-values/m-p/354309#M174642</link>
    <description>&lt;P&gt;regex101.com is your friend.  You can put an example text value to extract, and your regular expression, into the screen and it will show you what happens.  &lt;/P&gt;

&lt;P&gt;It's not always perfect in its match with what splunk will do, but in this case it would have taught you that the &lt;CODE&gt;|&lt;/CODE&gt; needed to be &lt;CODE&gt;\|&lt;/CODE&gt;.&lt;/P&gt;</description>
    <pubDate>Fri, 16 Jun 2017 11:38:07 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-06-16T11:38:07Z</dc:date>
    <item>
      <title>How to pull one variable with multiple changing values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pull-one-variable-with-multiple-changing-values/m-p/354304#M174637</link>
      <description>&lt;P&gt;I have for example something as follows, "Request X|Y|Z" where X, Y, and Z all change each time the message is displayed. In this case I only want to review value Z. I was thinking something like the following:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;rex (?&amp;lt;num1&amp;gt;\d)|(?&amp;lt;num2&amp;gt;\d)|(?&amp;lt;num3&amp;gt;\d)&lt;/CODE&gt;, but I am not getting he results back as expected. What would be the best way to handle this?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2017 12:04:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pull-one-variable-with-multiple-changing-values/m-p/354304#M174637</guid>
      <dc:creator>aohls</dc:creator>
      <dc:date>2017-06-15T12:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to pull one variable with multiple changing values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pull-one-variable-with-multiple-changing-values/m-p/354305#M174638</link>
      <description>&lt;P&gt;The vertical bars (|) in your events are literal, but when you use them in regex as shown, they become logical ORs.  You need to escape such special characters if they are literal.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex (?&amp;lt;num1&amp;gt;\d)\|(?&amp;lt;num2&amp;gt;\d)\|(?&amp;lt;num3&amp;gt;\d)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In fact if you are only interested in Z, you don't have to extract num1 and num2.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2017 15:40:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pull-one-variable-with-multiple-changing-values/m-p/354305#M174638</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2017-06-15T15:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to pull one variable with multiple changing values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pull-one-variable-with-multiple-changing-values/m-p/354306#M174639</link>
      <description>&lt;P&gt;Would I need to add anything to account for blank space? &lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2017 17:58:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pull-one-variable-with-multiple-changing-values/m-p/354306#M174639</guid>
      <dc:creator>aohls</dc:creator>
      <dc:date>2017-06-15T17:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to pull one variable with multiple changing values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pull-one-variable-with-multiple-changing-values/m-p/354307#M174640</link>
      <description>&lt;P&gt;Yes, if your data contains blank spaces, you need to account for them.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2017 18:21:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pull-one-variable-with-multiple-changing-values/m-p/354307#M174640</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2017-06-15T18:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to pull one variable with multiple changing values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pull-one-variable-with-multiple-changing-values/m-p/354308#M174641</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "(?&amp;lt;thing1&amp;gt;[^\|]+)|(?&amp;lt;thing2&amp;gt;&amp;gt;[^\|])|(?&amp;lt;thing3&amp;gt;&amp;gt;[^\|])"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Jun 2017 23:21:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pull-one-variable-with-multiple-changing-values/m-p/354308#M174641</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-06-15T23:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to pull one variable with multiple changing values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pull-one-variable-with-multiple-changing-values/m-p/354309#M174642</link>
      <description>&lt;P&gt;regex101.com is your friend.  You can put an example text value to extract, and your regular expression, into the screen and it will show you what happens.  &lt;/P&gt;

&lt;P&gt;It's not always perfect in its match with what splunk will do, but in this case it would have taught you that the &lt;CODE&gt;|&lt;/CODE&gt; needed to be &lt;CODE&gt;\|&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 11:38:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pull-one-variable-with-multiple-changing-values/m-p/354309#M174642</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-06-16T11:38:07Z</dc:date>
    </item>
  </channel>
</rss>

