<?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: Join events and evaluate difference price in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Join-events-and-evaluate-difference-price/m-p/354851#M104994</link>
    <description>&lt;P&gt;everything is fine except curly brances&lt;CODE&gt;{ }&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I understand it is like an array we can put some variables into single variable?&lt;BR /&gt;
Am i correct?&lt;/P&gt;

&lt;P&gt;If i am wrong, that means it is only a new variable.&lt;BR /&gt;
   what is the differnce between &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;eval {market} = price&lt;/CODE&gt;&lt;BR /&gt;
   &lt;CODE&gt;eval market = price&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Nov 2017 19:44:11 GMT</pubDate>
    <dc:creator>abdulvehhaba</dc:creator>
    <dc:date>2017-11-16T19:44:11Z</dc:date>
    <item>
      <title>Join events and evaluate difference price</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-events-and-evaluate-difference-price/m-p/354846#M104989</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I have data like this&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3818i4A6A8BFC70B27652/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I am joined uuid over market data together  like that&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3819i72D221E2D367DCC5/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;But there is 4 times date column i want to show only one and i want to add price difference column like&lt;/P&gt;

&lt;P&gt;Cex.io - koinim = 7280.10 - 7377.70 = 97.6 how can i achieve?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 20:40:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-events-and-evaluate-difference-price/m-p/354846#M104989</guid>
      <dc:creator>abdulvehhaba</dc:creator>
      <dc:date>2017-11-07T20:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Join events and evaluate difference price</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-events-and-evaluate-difference-price/m-p/354847#M104990</link>
      <description>&lt;P&gt;Which time you want to show (from which market)? Is the price diff columns (market names) are fixed?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 20:54:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-events-and-evaluate-difference-price/m-p/354847#M104990</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-11-07T20:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Join events and evaluate difference price</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-events-and-evaluate-difference-price/m-p/354848#M104991</link>
      <description>&lt;P&gt;You have three or more different markets at each point in time, so there are three or more different price differences.  With a fourth market, there are six different price differences; with five, there are ten.&lt;/P&gt;

&lt;P&gt;If I were you, for a dashboard, I would present two different panels, both using the same base search.  The first panel would be the actual prices.  The second would be the difference between the prices, in a specific order  (you pick one).&lt;/P&gt;

&lt;P&gt;Here's your base search...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="coinmarketcap_csv" etc.etc.etc.
| eval market = upper(substr(market,1,3))
| eval {market} = price
| fields - vol* market
| stats first(_time) as _time values(*) as * range(price) as HILO by uuid
| fields - price
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above gives you BTC, CEX, KOI and PAR as your four prices, with HILO as the difference between top and bottom prices. &lt;/P&gt;

&lt;P&gt;This section calculates the six differences. This is largely redundant, because any 3 encode all the rest. If you select one of them, for example BTC, as the "standard", then everything else stands in relationship to that standard, and you would only need the first three lines.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval BTCCEX = BTC - CEX
| eval BTCKOI = BTC - KOI
| eval BTCPAR = BTC - PAR
| eval CEXKOI = CEX - KOI
| eval CEXPAR = CEX - PAR
| eval KOIPAR = KOI - PAR
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See if the above helps you get what you want.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 01:06:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-events-and-evaluate-difference-price/m-p/354848#M104991</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-11-08T01:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Join events and evaluate difference price</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-events-and-evaluate-difference-price/m-p/354849#M104992</link>
      <description>&lt;P&gt;It works thanks; but i want to learn how it is work&lt;/P&gt;

&lt;P&gt;| eval market = upper(substr(market,1,3))&lt;BR /&gt;
              It takes first 3 charcter ok.&lt;BR /&gt;
 | eval {market} = price&lt;BR /&gt;
              what that mean { } &lt;BR /&gt;
 | fields - vol* market&lt;BR /&gt;
            it doesnt show vol and market&lt;/P&gt;

&lt;P&gt;| stats first(_time) as _time values(&lt;EM&gt;) as * range(price) as HILO by uuid&lt;BR /&gt;
           get first time as time ok&lt;BR /&gt;
           values(&lt;/EM&gt;) as *     for what?&lt;BR /&gt;
            * range(price) as HILO by uuid       and i dont understand?&lt;BR /&gt;
 | fields - price&lt;BR /&gt;
         dont show price&lt;/P&gt;

&lt;P&gt;| eval BTCCEX = BTC - CEX&lt;BR /&gt;
          it works and also i am add&lt;/P&gt;

&lt;P&gt;| eval BTCCEX = BTC - CEX | search  BTCCEX  &amp;gt; 50 &lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 18:47:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-events-and-evaluate-difference-price/m-p/354849#M104992</guid>
      <dc:creator>abdulvehhaba</dc:creator>
      <dc:date>2017-11-08T18:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Join events and evaluate difference price</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-events-and-evaluate-difference-price/m-p/354850#M104993</link>
      <description>&lt;P&gt;The curly braces &lt;CODE&gt;{}&lt;/CODE&gt; will take whatever value is in the variable and use that as the name of a new variable.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;stats values(test*) as val* by something&lt;/CODE&gt; will take each variable that starts with test, and will create a variable that starts with val, that contains all the values (up to 100).  So, for instance, &lt;CODE&gt;test1&lt;/CODE&gt; becomes &lt;CODE&gt;val1&lt;/CODE&gt;, &lt;CODE&gt;testfoo&lt;/CODE&gt; becomes a variable &lt;CODE&gt;valfoo&lt;/CODE&gt;.  &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;stats values(*) as *&lt;/CODE&gt; will take every field that isn't already part of the &lt;CODE&gt;by&lt;/CODE&gt; and roll together all the values (up to 100) into the same field name.    &lt;/P&gt;

&lt;P&gt;And that is the reason for the &lt;CODE&gt;fields -&lt;/CODE&gt; command before it... I don't want the system to spend any CPU time on the fields I am getting rid of.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;range(price) as HILO&lt;/CODE&gt;   The &lt;CODE&gt;range()&lt;/CODE&gt; is the difference between the highest and lowest values of something.  In this case, the highest price and the lowest price.  So that's your maximum delta.  You didn't really ask for it, but I'd put it there when working through your needs, and never took it out after I figured that you had several prices. &lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;The best way to understand what each line of code does is to start with the top selection criteria, add a &lt;CODE&gt;| head 10&lt;/CODE&gt; to get the first ten records of data, and then add back one line at a time, and see how that line transforms the data.   Seems like you did some of that.  Well done in figuring out what you did.   &lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 16:35:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-events-and-evaluate-difference-price/m-p/354850#M104993</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-11-13T16:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: Join events and evaluate difference price</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-events-and-evaluate-difference-price/m-p/354851#M104994</link>
      <description>&lt;P&gt;everything is fine except curly brances&lt;CODE&gt;{ }&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I understand it is like an array we can put some variables into single variable?&lt;BR /&gt;
Am i correct?&lt;/P&gt;

&lt;P&gt;If i am wrong, that means it is only a new variable.&lt;BR /&gt;
   what is the differnce between &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;eval {market} = price&lt;/CODE&gt;&lt;BR /&gt;
   &lt;CODE&gt;eval market = price&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 19:44:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-events-and-evaluate-difference-price/m-p/354851#M104994</guid>
      <dc:creator>abdulvehhaba</dc:creator>
      <dc:date>2017-11-16T19:44:11Z</dc:date>
    </item>
  </channel>
</rss>

