<?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: New Field From a Current Field Up to a Certain Character (In a Search) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156852#M44123</link>
    <description>&lt;P&gt;Good stuff here, everyone.  Thanks again!&lt;/P&gt;</description>
    <pubDate>Tue, 26 Nov 2013 16:19:25 GMT</pubDate>
    <dc:creator>aferone</dc:creator>
    <dc:date>2013-11-26T16:19:25Z</dc:date>
    <item>
      <title>New Field From a Current Field Up to a Certain Character (In a Search)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156840#M44111</link>
      <description>&lt;P&gt;I have a field named FieldA.  It looks like this:&lt;/P&gt;

&lt;P&gt;10.10.10.10-&amp;gt;10.11.11.11&lt;/P&gt;

&lt;P&gt;I want to create a new field (FieldB) that is everything left of the "-&amp;gt;".  I tried using LTRIM, among others, but I can't get it working.  This "seems" easy. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Help?&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2013 15:08:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156840#M44111</guid>
      <dc:creator>aferone</dc:creator>
      <dc:date>2013-11-26T15:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: New Field From a Current Field Up to a Certain Character (In a Search)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156841#M44112</link>
      <description>&lt;P&gt;Can you post the _raw event that contains the data?&lt;BR /&gt;
In the mean time, have you tried &lt;BR /&gt;
&lt;CODE&gt;rex ".*-&amp;gt;(?&amp;lt;newfield&amp;gt;\d+\.\d+\.\d+\.\d+)\D.*"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Is the new field always an IP?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2013 15:20:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156841#M44112</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-11-26T15:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: New Field From a Current Field Up to a Certain Character (In a Search)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156842#M44113</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; ... | rex field=fieldA "^(?&amp;lt;fieldB&amp;gt;[\d.]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;should do it...&lt;/P&gt;

&lt;P&gt;/k &lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2013 15:20:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156842#M44113</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-11-26T15:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: New Field From a Current Field Up to a Certain Character (In a Search)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156843#M44114</link>
      <description>&lt;P&gt;Hmmm.  I tried this, but I'm not getting data back in the new field.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2013 15:28:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156843#M44114</guid>
      <dc:creator>aferone</dc:creator>
      <dc:date>2013-11-26T15:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: New Field From a Current Field Up to a Certain Character (In a Search)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156844#M44115</link>
      <description>&lt;P&gt;Is there a typo in the field name? The first F of the field name is uppercase?&lt;/P&gt;

&lt;P&gt;... | rex field=FieldA "^(?&lt;FIELDB&gt;[\d.]+)"&lt;/FIELDB&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2013 15:32:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156844#M44115</guid>
      <dc:creator>gfuente</dc:creator>
      <dc:date>2013-11-26T15:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: New Field From a Current Field Up to a Certain Character (In a Search)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156845#M44116</link>
      <description>&lt;P&gt;Combine Kristian and Luke's answers:&lt;/P&gt;

&lt;P&gt;... | rex field=fieldA "^(?&lt;NEWFIELD&gt;\d+\.\d+\.\d+\.\d+)"&lt;/NEWFIELD&gt;&lt;/P&gt;

&lt;P&gt;This should do it. Luke's answer was getting the right side of your fieldA, while Kristian's answer wasn't properly accounting for the periods in the IP.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2013 15:34:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156845#M44116</guid>
      <dc:creator>aholzer</dc:creator>
      <dc:date>2013-11-26T15:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: New Field From a Current Field Up to a Certain Character (In a Search)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156846#M44117</link>
      <description>&lt;P&gt;Nope, no typos.  &lt;/P&gt;

&lt;P&gt;How does the rex work with this?  How does it know to stop at the dash in the original string?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2013 15:34:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156846#M44117</guid>
      <dc:creator>aferone</dc:creator>
      <dc:date>2013-11-26T15:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: New Field From a Current Field Up to a Certain Character (In a Search)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156847#M44118</link>
      <description>&lt;P&gt;OK, I removed my top and table commands, and the rex is working just fine.  I need to see how to format this data now.  Thank you very much!!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2013 15:36:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156847#M44118</guid>
      <dc:creator>aferone</dc:creator>
      <dc:date>2013-11-26T15:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: New Field From a Current Field Up to a Certain Character (In a Search)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156848#M44119</link>
      <description>&lt;P&gt;How, can you explain exactly how this work?  My RegEx is terrible.  Thanks again!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2013 15:37:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156848#M44119</guid>
      <dc:creator>aferone</dc:creator>
      <dc:date>2013-11-26T15:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: New Field From a Current Field Up to a Certain Character (In a Search)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156849#M44120</link>
      <description>&lt;P&gt;&lt;A href="http://www.splunk.com/web_assets/pdfs/secure/Splunk_Quick_Reference_Guide.pdf"&gt;http://www.splunk.com/web_assets/pdfs/secure/Splunk_Quick_Reference_Guide.pdf&lt;/A&gt;  may help.. I'm not that good myself and am not quite sure how it excludes the -&amp;gt; myself but you could include the -&amp;gt; at the very end if you wanted.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2013 15:47:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156849#M44120</guid>
      <dc:creator>aelliott</dc:creator>
      <dc:date>2013-11-26T15:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: New Field From a Current Field Up to a Certain Character (In a Search)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156850#M44121</link>
      <description>&lt;P&gt;Kristian's capture group includes only digits and dots, so when it gets to the -&amp;gt; it stops, and the ? grabs the first set that matches the group.&lt;BR /&gt;&lt;BR /&gt;
I forgot which way left was.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2013 15:52:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156850#M44121</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-11-26T15:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: New Field From a Current Field Up to a Certain Character (In a Search)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156851#M44122</link>
      <description>&lt;P&gt;so if it weren't always numbers and dots then &lt;BR /&gt;
rex field=FieldA "^(?&lt;FIELDB&gt;.*)-&amp;gt;" would work.. after all.. it could be an IPv6&lt;/FIELDB&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2013 16:11:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156851#M44122</guid>
      <dc:creator>aelliott</dc:creator>
      <dc:date>2013-11-26T16:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: New Field From a Current Field Up to a Certain Character (In a Search)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156852#M44123</link>
      <description>&lt;P&gt;Good stuff here, everyone.  Thanks again!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2013 16:19:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156852#M44123</guid>
      <dc:creator>aferone</dc:creator>
      <dc:date>2013-11-26T16:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: New Field From a Current Field Up to a Certain Character (In a Search)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156853#M44124</link>
      <description>&lt;P&gt;Sorry, I could have explained more clearly;&lt;/P&gt;

&lt;P&gt;From the start of the string - &lt;STRONG&gt;^&lt;/STRONG&gt; - start capturing - &lt;STRONG&gt;(&lt;/STRONG&gt; - a field called fieldb - &lt;STRONG&gt;?&lt;FIELDB&gt;&lt;/FIELDB&gt;&lt;/STRONG&gt; - that consists of one or more digits and dots - &lt;STRONG&gt;[\d.]+&lt;/STRONG&gt; - and then stop the capture - &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;/k&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2013 16:20:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156853#M44124</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-11-26T16:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: New Field From a Current Field Up to a Certain Character (In a Search)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156854#M44125</link>
      <description>&lt;P&gt;Thanks, Kristian!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2013 16:44:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/New-Field-From-a-Current-Field-Up-to-a-Certain-Character-In-a/m-p/156854#M44125</guid>
      <dc:creator>aferone</dc:creator>
      <dc:date>2013-11-26T16:44:00Z</dc:date>
    </item>
  </channel>
</rss>

