<?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 How to use rex to extract a field that starts with another field value? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-a-field-that-starts-with-another-field/m-p/113290#M29794</link>
    <description>&lt;P&gt;Hi.&lt;/P&gt;

&lt;P&gt;I'd like to rex a field that starts with another field value.&lt;/P&gt;

&lt;P&gt;EX:&lt;/P&gt;

&lt;P&gt;****Data&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;UA=Mozilla/5.0 (Linux; Android 4.0.3; GT-I9100 Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19
AV=18.0.1025
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;****Desired&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;AV2=18.0.1025.166
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;****Search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup VERSION.csv
| rex field=UA "&amp;lt;AV&amp;gt;.(?&amp;lt;AV1&amp;gt;\d+)\s"
| eval AV2=AV+"."+AV1
| eval AV2=if(isnull(AV2),AV,AV2)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 23 Mar 2015 17:52:15 GMT</pubDate>
    <dc:creator>pedromvieira</dc:creator>
    <dc:date>2015-03-23T17:52:15Z</dc:date>
    <item>
      <title>How to use rex to extract a field that starts with another field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-a-field-that-starts-with-another-field/m-p/113290#M29794</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;

&lt;P&gt;I'd like to rex a field that starts with another field value.&lt;/P&gt;

&lt;P&gt;EX:&lt;/P&gt;

&lt;P&gt;****Data&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;UA=Mozilla/5.0 (Linux; Android 4.0.3; GT-I9100 Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19
AV=18.0.1025
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;****Desired&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;AV2=18.0.1025.166
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;****Search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup VERSION.csv
| rex field=UA "&amp;lt;AV&amp;gt;.(?&amp;lt;AV1&amp;gt;\d+)\s"
| eval AV2=AV+"."+AV1
| eval AV2=if(isnull(AV2),AV,AV2)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Mar 2015 17:52:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-a-field-that-starts-with-another-field/m-p/113290#M29794</guid>
      <dc:creator>pedromvieira</dc:creator>
      <dc:date>2015-03-23T17:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to use rex to extract a field that starts with another field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-a-field-that-starts-with-another-field/m-p/113291#M29795</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup VERSION.csv
| eval UA1=replace(UA,AV.".","MyField=")
| rex field=UA1 "MyField=(?&amp;lt;AV1&amp;gt;\d+)\s"
| eval AV2=AV+"."+AV1
| eval AV2=if(isnull(AV2),AV,AV2)
| fields - UA1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Mar 2015 20:06:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-a-field-that-starts-with-another-field/m-p/113291#M29795</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-03-23T20:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to use rex to extract a field that starts with another field value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-a-field-that-starts-with-another-field/m-p/113292#M29796</link>
      <description>&lt;P&gt;Perfect. Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2015 20:19:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-a-field-that-starts-with-another-field/m-p/113292#M29796</guid>
      <dc:creator>pedromvieira</dc:creator>
      <dc:date>2015-03-23T20:19:29Z</dc:date>
    </item>
  </channel>
</rss>

