<?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: eval a new field base on a search result in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/eval-a-new-field-base-on-a-search-result/m-p/536044#M151546</link>
    <description>&lt;P&gt;| appendcols [ search .... ] works&lt;/P&gt;</description>
    <pubDate>Fri, 15 Jan 2021 19:41:56 GMT</pubDate>
    <dc:creator>tpask</dc:creator>
    <dc:date>2021-01-15T19:41:56Z</dc:date>
    <item>
      <title>eval a new field base on a search result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-a-new-field-base-on-a-search-result/m-p/133802#M36567</link>
      <description>&lt;P&gt;hey ninjas,&lt;/P&gt;

&lt;P&gt;i have a search result like the following:&lt;/P&gt;

&lt;P&gt;error_code1  42&lt;BR /&gt;
error_code2  55&lt;BR /&gt;
error_code3  62&lt;BR /&gt;
error_code4  17&lt;/P&gt;

&lt;P&gt;i want to append a colum at the right side&lt;BR /&gt;
the value of the colum is base on a search result ( such as index=nijia | stats count)&lt;BR /&gt;
i expect it  to looked like the this:&lt;/P&gt;

&lt;P&gt;error_code1 42 100&lt;BR /&gt;
error_code2 55 100&lt;BR /&gt;
error_code3 62 100&lt;BR /&gt;
error_code4 17 100&lt;/P&gt;

&lt;P&gt;i think i should use "eval" to get the new colum , but i do not know how to eval a new field base on a search result&lt;BR /&gt;
do you have any ideas?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:38:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-a-new-field-base-on-a-search-result/m-p/133802#M36567</guid>
      <dc:creator>gfs2277</dc:creator>
      <dc:date>2020-09-28T17:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: eval a new field base on a search result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-a-new-field-base-on-a-search-result/m-p/133803#M36568</link>
      <description>&lt;P&gt;please note the search ( what the eval base on ) just return single value ( not multi-row )&lt;BR /&gt;
so appendcols will not works in this case&lt;/P&gt;</description>
      <pubDate>Sat, 20 Sep 2014 09:31:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-a-new-field-base-on-a-search-result/m-p/133803#M36568</guid>
      <dc:creator>gfs2277</dc:creator>
      <dc:date>2014-09-20T09:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: eval a new field base on a search result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-a-new-field-base-on-a-search-result/m-p/133804#M36569</link>
      <description>&lt;P&gt;Did you try addtotals &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.3/SearchReference/Addtotals"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.3/SearchReference/Addtotals&lt;/A&gt; ?&lt;/P&gt;</description>
      <pubDate>Sat, 20 Sep 2014 10:28:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-a-new-field-base-on-a-search-result/m-p/133804#M36569</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-09-20T10:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: eval a new field base on a search result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-a-new-field-base-on-a-search-result/m-p/133805#M36570</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;Your base search giving error_code, count | eval newCol=[ search index=ninja |stats count | return $count]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 20 Sep 2014 13:18:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-a-new-field-base-on-a-search-result/m-p/133805#M36570</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-09-20T13:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: eval a new field base on a search result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-a-new-field-base-on-a-search-result/m-p/133806#M36571</link>
      <description>&lt;P&gt;Here are a couple of other options:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| appendcol [subsearch]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;as well, but this will only match the values line by line in the order that the results appear from the subsearch.  Or you could use&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| join field1 [subsearch]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to match the results to the base search as they match on field1.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Nov 2014 20:02:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-a-new-field-base-on-a-search-result/m-p/133806#M36571</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2014-11-03T20:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: eval a new field base on a search result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-a-new-field-base-on-a-search-result/m-p/133807#M36572</link>
      <description>&lt;P&gt;This didn't work for me, but this did:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval [ | rest splunk_server=local /services/server/info | return host ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Jul 2019 12:23:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-a-new-field-base-on-a-search-result/m-p/133807#M36572</guid>
      <dc:creator>ruman_splunk</dc:creator>
      <dc:date>2019-07-11T12:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: eval a new field base on a search result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-a-new-field-base-on-a-search-result/m-p/536044#M151546</link>
      <description>&lt;P&gt;| appendcols [ search .... ] works&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 19:41:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-a-new-field-base-on-a-search-result/m-p/536044#M151546</guid>
      <dc:creator>tpask</dc:creator>
      <dc:date>2021-01-15T19:41:56Z</dc:date>
    </item>
  </channel>
</rss>

