<?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 with dynamic column names in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/eval-with-dynamic-column-names/m-p/293264#M88524</link>
    <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search giving table in your ques
| rename Base* as Base
| foreach Test* [| eval "diff_&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;"=Base-'&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;']
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 22 Nov 2017 14:41:31 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-11-22T14:41:31Z</dc:date>
    <item>
      <title>eval with dynamic column names</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-with-dynamic-column-names/m-p/293263#M88523</link>
      <description>&lt;P&gt;I have a table of data as follows:&lt;BR /&gt;
KPI / Base:(date1) / Test:(date1) / Test:(date2) / Test:(daten)&lt;BR /&gt;
KPI1 / 1.5 / 1.8 / 1.2 / 1.7&lt;BR /&gt;
KPI2 / 2.1 / 2.5 / 1.9 / 2.2&lt;/P&gt;

&lt;P&gt;I need to be able to calculate the difference between each test column to base column using eval.  The test column name is dynamic as it has the date that the test was executed.  &lt;/P&gt;

&lt;P&gt;How do I handle the fact that the test column names are dynamic?  They will all contain Test, or some other consistent string.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2017 14:35:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-with-dynamic-column-names/m-p/293263#M88523</guid>
      <dc:creator>mschellhouse</dc:creator>
      <dc:date>2017-11-22T14:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: eval with dynamic column names</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-with-dynamic-column-names/m-p/293264#M88524</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search giving table in your ques
| rename Base* as Base
| foreach Test* [| eval "diff_&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;"=Base-'&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;']
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Nov 2017 14:41:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-with-dynamic-column-names/m-p/293264#M88524</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-11-22T14:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: eval with dynamic column names</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-with-dynamic-column-names/m-p/293265#M88525</link>
      <description>&lt;P&gt;The rename didn't work but I got around that.  The foreach and eval were very helpful.  Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2017 17:54:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-with-dynamic-column-names/m-p/293265#M88525</guid>
      <dc:creator>mschellhouse</dc:creator>
      <dc:date>2017-11-22T17:54:28Z</dc:date>
    </item>
  </channel>
</rss>

