<?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 search results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/New-field-from-search-results/m-p/304521#M175506</link>
    <description>&lt;P&gt;The &lt;CODE&gt;substr&lt;/CODE&gt; method returns a new field with the first character of the OrgCode field.  What I need is a field for DeptL where only the OrgCodes that start with L are in it.  Then a DeptK field with only the OrgCodes that start with K are in it, and so on.  This seems logical to me but doesn't work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; eval DeptA=[search OrgCode=A*]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 15 Feb 2017 17:28:11 GMT</pubDate>
    <dc:creator>nburgess1</dc:creator>
    <dc:date>2017-02-15T17:28:11Z</dc:date>
    <item>
      <title>New field from search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/New-field-from-search-results/m-p/304518#M175503</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a field called "OrgCode" with data like "L6"  "L9" "G6" "K6" "K4", which is departments L G and K.  I need to get a new field for each department.  &lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 14:27:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/New-field-from-search-results/m-p/304518#M175503</guid>
      <dc:creator>nburgess1</dc:creator>
      <dc:date>2017-02-15T14:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: New field from search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/New-field-from-search-results/m-p/304519#M175504</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search which include field OrgCode | eval Deparment=replace(OrgCode,"^([A-z]+)\d+","\1")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Feb 2017 16:45:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/New-field-from-search-results/m-p/304519#M175504</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-02-15T16:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: New field from search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/New-field-from-search-results/m-p/304520#M175505</link>
      <description>&lt;P&gt;Assuming the department code is always the first character of OrgCode, one of these should do the job.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=OrgCode "(?&amp;lt;dept&amp;gt;\w)" | ...

... | eval dept = substr(OrgCode, 1, 1) | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Feb 2017 16:48:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/New-field-from-search-results/m-p/304520#M175505</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-02-15T16:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: New field from search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/New-field-from-search-results/m-p/304521#M175506</link>
      <description>&lt;P&gt;The &lt;CODE&gt;substr&lt;/CODE&gt; method returns a new field with the first character of the OrgCode field.  What I need is a field for DeptL where only the OrgCodes that start with L are in it.  Then a DeptK field with only the OrgCodes that start with K are in it, and so on.  This seems logical to me but doesn't work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; eval DeptA=[search OrgCode=A*]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Feb 2017 17:28:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/New-field-from-search-results/m-p/304521#M175506</guid>
      <dc:creator>nburgess1</dc:creator>
      <dc:date>2017-02-15T17:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: New field from search results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/New-field-from-search-results/m-p/304522#M175507</link>
      <description>&lt;P&gt;After the field Department/dept is created, you will be able to filter records for a single department. &lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 17:33:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/New-field-from-search-results/m-p/304522#M175507</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-02-15T17:33:04Z</dc:date>
    </item>
  </channel>
</rss>

