<?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: Extract a field from a field in splunk? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-a-field-from-a-field-in-splunk/m-p/608746#M211718</link>
    <description>&lt;P&gt;For extracting a field from a field use the &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; command.&amp;nbsp; This regex puts everything up to the first space into the new field.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=code_value "(?&amp;lt;new_field_derived_from_code_value&amp;gt;\S+)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Aug 2022 20:41:04 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2022-08-08T20:41:04Z</dc:date>
    <item>
      <title>Extract a field from a field in splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-a-field-from-a-field-in-splunk/m-p/608736#M211717</link>
      <description>&lt;P&gt;I have a field names "code_value" which has the values as follows&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;code_value
ABC-123 JHLIK
ABC-456 LKJF
ABC-781 klklk
ABC-22 olsd&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now how do I extract the code_value field anything that comes before a space? something like below&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;new_field_derived_from_code_value
ABC-123 
ABC-456 
ABC-781 
ABC-22 &lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 08 Aug 2022 20:06:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-a-field-from-a-field-in-splunk/m-p/608736#M211717</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2022-08-08T20:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: Extract a field from a field in splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-a-field-from-a-field-in-splunk/m-p/608746#M211718</link>
      <description>&lt;P&gt;For extracting a field from a field use the &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; command.&amp;nbsp; This regex puts everything up to the first space into the new field.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=code_value "(?&amp;lt;new_field_derived_from_code_value&amp;gt;\S+)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 20:41:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-a-field-from-a-field-in-splunk/m-p/608746#M211718</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-08-08T20:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: Extract a field from a field in splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-a-field-from-a-field-in-splunk/m-p/608857#M211719</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/79709"&gt;@pavanae&lt;/a&gt;&amp;nbsp;, you can try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval code_value ="ABC-123 JHLIK,
ABC-456 LKJF,
ABC-781 klklk,
ABC-22 olsd" 
| makemv delim="," code_value 
| mvexpand code_value 
| eval result=mvindex(split(code_value," "),0)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 09 Aug 2022 13:18:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-a-field-from-a-field-in-splunk/m-p/608857#M211719</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2022-08-09T13:18:00Z</dc:date>
    </item>
  </channel>
</rss>

