<?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 rex field to a field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-rex-field-to-a-field/m-p/467579#M131591</link>
    <description>&lt;P&gt;I have a rex as such:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=host "(?&amp;lt;sydney&amp;gt;10-92-3[2-4])" | rex field=host "(?&amp;lt;melbourne&amp;gt;10-92-11[0-2])"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which returns 2 fields. &lt;STRONG&gt;sydney&lt;/STRONG&gt; and &lt;STRONG&gt;melbourne&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Now I want to have the fields returned to a field &lt;STRONG&gt;city&lt;/STRONG&gt;. How can i do this? &lt;/P&gt;</description>
    <pubDate>Tue, 07 Apr 2020 01:18:29 GMT</pubDate>
    <dc:creator>racans</dc:creator>
    <dc:date>2020-04-07T01:18:29Z</dc:date>
    <item>
      <title>How to rex field to a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rex-field-to-a-field/m-p/467579#M131591</link>
      <description>&lt;P&gt;I have a rex as such:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=host "(?&amp;lt;sydney&amp;gt;10-92-3[2-4])" | rex field=host "(?&amp;lt;melbourne&amp;gt;10-92-11[0-2])"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which returns 2 fields. &lt;STRONG&gt;sydney&lt;/STRONG&gt; and &lt;STRONG&gt;melbourne&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Now I want to have the fields returned to a field &lt;STRONG&gt;city&lt;/STRONG&gt;. How can i do this? &lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 01:18:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rex-field-to-a-field/m-p/467579#M131591</guid>
      <dc:creator>racans</dc:creator>
      <dc:date>2020-04-07T01:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to rex field to a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rex-field-to-a-field/m-p/467580#M131592</link>
      <description>&lt;P&gt;If you use REX&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults |eval host ="10-92-110"|eval city=host 
| rex field=city mode=sed "s/10-92-3[2-4]/sydney/g" 
| rex field=city mode=sed "s/10-92-11[0-2]/melbourne/g"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In my case I use LOOKUP to convert.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 02:30:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rex-field-to-a-field/m-p/467580#M131592</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2020-04-07T02:30:31Z</dc:date>
    </item>
  </channel>
</rss>

