<?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 How to store a value in splunk and use the value in other search in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/How-to-store-a-value-in-splunk-and-use-the-value-in-other-search/m-p/468539#M4135</link>
    <description>&lt;P&gt;in this code i need to store Energ1 with numerical value and the energy1 with the string values and use these values in the last search is it possible to do &lt;/P&gt;

&lt;P&gt;index=coemission |search household_id="1"| stats sum(energy_consumed_kwh_per_day) as Energ|eval Energ1=Energ&lt;/P&gt;

&lt;P&gt;|append [ search index=coemission|search household_id ="1"|stats values(energy_provider) as energy|eval energy1=energy]&lt;/P&gt;

&lt;P&gt;|append [search sourcetype="energyscore"|search energy_provider=energy|stats sum(nuclear) as nuclear,sum(lignite) as lignite,sum(hardcoal) as hardcoal,sum(natural gas) as naturalgas,sum(renewables) as renewables,sum(others) as others   &lt;/P&gt;

&lt;P&gt;|eval nuclear1=nuclear*Energ1|eval lignite1=lignite*Energ1|eval hardcoal1=hardcoal*Energ1|eval naturalgas1=naturalgas*Energ1|eval renewables1=renewables*Energ1|eval others=others*Energ1|fields - nuclear,lignite,hardcoal,naturalgas,renewables,others]&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 03:25:19 GMT</pubDate>
    <dc:creator>raghav4a1</dc:creator>
    <dc:date>2020-09-30T03:25:19Z</dc:date>
    <item>
      <title>How to store a value in splunk and use the value in other search</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-store-a-value-in-splunk-and-use-the-value-in-other-search/m-p/468539#M4135</link>
      <description>&lt;P&gt;in this code i need to store Energ1 with numerical value and the energy1 with the string values and use these values in the last search is it possible to do &lt;/P&gt;

&lt;P&gt;index=coemission |search household_id="1"| stats sum(energy_consumed_kwh_per_day) as Energ|eval Energ1=Energ&lt;/P&gt;

&lt;P&gt;|append [ search index=coemission|search household_id ="1"|stats values(energy_provider) as energy|eval energy1=energy]&lt;/P&gt;

&lt;P&gt;|append [search sourcetype="energyscore"|search energy_provider=energy|stats sum(nuclear) as nuclear,sum(lignite) as lignite,sum(hardcoal) as hardcoal,sum(natural gas) as naturalgas,sum(renewables) as renewables,sum(others) as others   &lt;/P&gt;

&lt;P&gt;|eval nuclear1=nuclear*Energ1|eval lignite1=lignite*Energ1|eval hardcoal1=hardcoal*Energ1|eval naturalgas1=naturalgas*Energ1|eval renewables1=renewables*Energ1|eval others=others*Energ1|fields - nuclear,lignite,hardcoal,naturalgas,renewables,others]&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:25:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-store-a-value-in-splunk-and-use-the-value-in-other-search/m-p/468539#M4135</guid>
      <dc:creator>raghav4a1</dc:creator>
      <dc:date>2020-09-30T03:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to store a value in splunk and use the value in other search</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-store-a-value-in-splunk-and-use-the-value-in-other-search/m-p/468540#M4136</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="YouShouldAlwaysSpecifyAnIndex" AND sourcetype="energyscore" AND energy_provider="energy"
|stats sum(nuclear) AS nuclear sum(lignite) AS lignite sum(hardcoal) AS hardcoal sum(natural gas) AS naturalgas sum(renewables) AS renewables,sum(others) AS others 
|foreach nuclear lignite hardcoal naturalgas renewables others
[ eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;1 = &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; * [search index=coemission AND household_id="1" | stats sum(energy_consumed_kwh_per_day) AS Energ | return $Energ ] | fields - &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Dec 2019 10:35:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-store-a-value-in-splunk-and-use-the-value-in-other-search/m-p/468540#M4136</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-20T10:35:15Z</dc:date>
    </item>
  </channel>
</rss>

