<?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: Pulling Last Integer Value from Unlabeled Field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Pulling-Last-Integer-Value-from-Unlabeled-Field/m-p/171574#M49175</link>
    <description>&lt;P&gt;The $ means "the end of the line", so in this case it give regex an anchor - it tells regex to basically look backwards from the end of the line.  The ^ is the symbol for the beginning of the line.&lt;/P&gt;</description>
    <pubDate>Tue, 20 May 2014 14:36:11 GMT</pubDate>
    <dc:creator>lukejadamec</dc:creator>
    <dc:date>2014-05-20T14:36:11Z</dc:date>
    <item>
      <title>Pulling Last Integer Value from Unlabeled Field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pulling-Last-Integer-Value-from-Unlabeled-Field/m-p/171568#M49169</link>
      <description>&lt;P&gt;Hi, this is a 3-line sample of my data:  What I'm trying to do is get ahold of the last two fields (524288000 and 188077720 in line 1) so I can plot their trends in a graph.  How would I go about doing this?  I've looked into &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1/SearchReference/Extract"&gt;extract(kv)&lt;/A&gt; and &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1/SearchReference/kvform"&gt;kvform&lt;/A&gt; and have some limited experience in &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.1/SearchReference/rex"&gt;rex fields&lt;/A&gt;, but I'm pretty new to this so any help would be appreciated.  Thank you!&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;34 Mon May 19 13:00:09 EDT 2014    271764960   1   PS MarkSweep    0   0.0 0   0.0         524288000   524288000   524288000   188077720&lt;BR /&gt;
34  Mon May 19 13:00:09 EDT 2014    271764990   2   PS MarkSweep    0   0.0 0   0.0         521666560   524288000   521666560   186098608&lt;BR /&gt;
34  Mon May 19 13:00:09 EDT 2014    271764995   3   PS MarkSweep    0   0.0 0   0.0         523763712   524288000   523763712   147496952&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2014 12:35:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pulling-Last-Integer-Value-from-Unlabeled-Field/m-p/171568#M49169</guid>
      <dc:creator>ctallarico20</dc:creator>
      <dc:date>2014-05-20T12:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling Last Integer Value from Unlabeled Field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pulling-Last-Integer-Value-from-Unlabeled-Field/m-p/171569#M49170</link>
      <description>&lt;P&gt;You should use rex.  &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;your search that produced this output | rex "(?P&amp;lt;firstnumber&amp;gt;\d+)\s+(?P&amp;lt;secondnumber&amp;gt;\d+)$"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The above search should create two new fields called firstnumber and secondnumber.&lt;BR /&gt;
Edited to include a closing quote.&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2014 13:08:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pulling-Last-Integer-Value-from-Unlabeled-Field/m-p/171569#M49170</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2014-05-20T13:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling Last Integer Value from Unlabeled Field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pulling-Last-Integer-Value-from-Unlabeled-Field/m-p/171570#M49171</link>
      <description>&lt;P&gt;Thanks for the help!&lt;BR /&gt;
I tried using the rex command &lt;BR /&gt;
&lt;CODE&gt;rex "(?P&amp;lt;firstnumber&amp;gt;\d+)\s+(?P&amp;lt;secondnumber&amp;gt;\d+)\s+(?P&amp;lt;thirdnumber&amp;gt;\d+)\s+(?P&amp;lt;fourthnumber&amp;gt;\d+)\s+(?P&amp;lt;fifthnumber&amp;gt;\d+)"&lt;/CODE&gt;&lt;BR /&gt;
On this search, but I'm getting some weird behavior.  In the above example, firstnumber is 19 (as in May 19), secondnumber is 13 (the hour), thirdnumber is 1, 2, or 3 for the respective line, fourthnumber is 524288000, 521666560, 523763712, and fifthnumber is 188077720, 186098608,147496952.  As you can see, I'm getting the 4th-to-last as fourthnumber and then skipping to the last for fifthnumber, do you know why?&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2014 13:52:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pulling-Last-Integer-Value-from-Unlabeled-Field/m-p/171570#M49171</guid>
      <dc:creator>ctallarico20</dc:creator>
      <dc:date>2014-05-20T13:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling Last Integer Value from Unlabeled Field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pulling-Last-Integer-Value-from-Unlabeled-Field/m-p/171571#M49172</link>
      <description>&lt;P&gt;I think you forgot the $ at the end.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;rex "(?P&amp;lt;firstnumber&amp;gt;\d+)\s+(?P&amp;lt;secondnumber&amp;gt;\d+)\s+(?P&amp;lt;thirdnumber&amp;gt;\d+)\s+(?P&amp;lt;fourthnumber&amp;gt;\d+)\s+(?P&amp;lt;fifthnumber&amp;gt;\d+)$"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2014 13:57:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pulling-Last-Integer-Value-from-Unlabeled-Field/m-p/171571#M49172</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2014-05-20T13:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling Last Integer Value from Unlabeled Field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pulling-Last-Integer-Value-from-Unlabeled-Field/m-p/171572#M49173</link>
      <description>&lt;P&gt;Did you miss the "$" sign from the regex?&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2014 13:59:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pulling-Last-Integer-Value-from-Unlabeled-Field/m-p/171572#M49173</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-05-20T13:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling Last Integer Value from Unlabeled Field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pulling-Last-Integer-Value-from-Unlabeled-Field/m-p/171573#M49174</link>
      <description>&lt;P&gt;Yeah, you guys were right!  If you don't mind me asking, what does the $ command do?  I'd love to understand a little how these results are being found&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2014 14:33:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pulling-Last-Integer-Value-from-Unlabeled-Field/m-p/171573#M49174</guid>
      <dc:creator>ctallarico20</dc:creator>
      <dc:date>2014-05-20T14:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling Last Integer Value from Unlabeled Field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pulling-Last-Integer-Value-from-Unlabeled-Field/m-p/171574#M49175</link>
      <description>&lt;P&gt;The $ means "the end of the line", so in this case it give regex an anchor - it tells regex to basically look backwards from the end of the line.  The ^ is the symbol for the beginning of the line.&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2014 14:36:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pulling-Last-Integer-Value-from-Unlabeled-Field/m-p/171574#M49175</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2014-05-20T14:36:11Z</dc:date>
    </item>
  </channel>
</rss>

