<?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: How to add a column to the results table based on an existing field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-a-column-to-the-results-table-based-on-an-existing/m-p/362928#M107229</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;You can use appendcols command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search here&amp;gt; 
  | chart latest(Data) AS "Data" over Time by Thread
  | sort + Time 
  | eval Goal=25 
  | eval Min=18 
  | appendcols [search &amp;lt;search here&amp;gt; | eval LastPrimer=Primer | table LastPrimer`]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Simple Example (You can past this request in your bare search):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  index="_internal" 
    | bin _time span=1d
    | stats count by _time
    | appendcols 
        [search index="_internal" 
        | table log_level 
        | dedup log_level]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 25 Apr 2018 22:19:13 GMT</pubDate>
    <dc:creator>TISKAR</dc:creator>
    <dc:date>2018-04-25T22:19:13Z</dc:date>
    <item>
      <title>How to add a column to the results table based on an existing field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-a-column-to-the-results-table-based-on-an-existing/m-p/362927#M107228</link>
      <description>&lt;P&gt;Hello:&lt;/P&gt;

&lt;P&gt;I am trying to add a column to the results table, the reason for this is so that I can then use that value for populating a token. Here is the search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;1.  &amp;lt;search here&amp;gt; 
2.  | chart latest(Data) AS "Data" over Time by Thread
3.  | sort + Time 
4.  | eval Goal=25 
5.  | eval Min=18 
6.  | eval LastPrimer=Primer
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The results table of this looks like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  Time   Goal    Min             data1    data2    data3
    0    25          18                   29.2728     26.2105   14.8187
    1    25          18                 29.6007   28.9153   14.9330
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to also see LastPrimer in the results table. Primer is an indexed field. &lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 20:36:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-a-column-to-the-results-table-based-on-an-existing/m-p/362927#M107228</guid>
      <dc:creator>ivtashev</dc:creator>
      <dc:date>2018-04-25T20:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a column to the results table based on an existing field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-a-column-to-the-results-table-based-on-an-existing/m-p/362928#M107229</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;You can use appendcols command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search here&amp;gt; 
  | chart latest(Data) AS "Data" over Time by Thread
  | sort + Time 
  | eval Goal=25 
  | eval Min=18 
  | appendcols [search &amp;lt;search here&amp;gt; | eval LastPrimer=Primer | table LastPrimer`]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Simple Example (You can past this request in your bare search):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  index="_internal" 
    | bin _time span=1d
    | stats count by _time
    | appendcols 
        [search index="_internal" 
        | table log_level 
        | dedup log_level]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Apr 2018 22:19:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-a-column-to-the-results-table-based-on-an-existing/m-p/362928#M107229</guid>
      <dc:creator>TISKAR</dc:creator>
      <dc:date>2018-04-25T22:19:13Z</dc:date>
    </item>
  </channel>
</rss>

