<?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: Graphing negative values OR converting the values to positive in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Graphing-negative-values-OR-converting-the-values-to-positive/m-p/419225#M7331</link>
    <description>&lt;P&gt;whups forgot the other part.  If there is a way to graph negative numbers I'd do that as well&lt;/P&gt;</description>
    <pubDate>Fri, 25 May 2018 17:39:01 GMT</pubDate>
    <dc:creator>dbcase</dc:creator>
    <dc:date>2018-05-25T17:39:01Z</dc:date>
    <item>
      <title>Graphing negative values OR converting the values to positive</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Graphing-negative-values-OR-converting-the-values-to-positive/m-p/419224#M7330</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm trying to do a time chart of RSSI values (typically negative values).  I have a query that extracts the values and puts them into a table (just for troubleshooting).  I'm also trying to convert the values to positive using the abs function but it keeps coming up blank.  I've checked using isstr to see if the values were a string and needed to be converted but the function returned no (it is not a string).  Can't figure out what the heck is wrong here.  Thoughts?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=-4hr index="camera_status" sourcetype=access_combined_camerastatus 8773|rex max_match=0 "Premise=\s+(?&amp;lt;premiseid&amp;gt;\d+)"|rex max_match=0 "Mac=\s+(?&amp;lt;macid&amp;gt;[a-fA-F0-9\.:-]{12,17})"|rex max_match=0 "RSSI=\s+(?&amp;lt;rssiid&amp;gt;[^\s]+)"|eval n=abs(rssiid)|table n rssiid
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Resulting table.  As you can see the rssiid comes across just fine but n (where I'm doing the eval/abs) is null&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/5049i15A8124F35DDF6D8/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2018 17:38:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Graphing-negative-values-OR-converting-the-values-to-positive/m-p/419224#M7330</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2018-05-25T17:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Graphing negative values OR converting the values to positive</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Graphing-negative-values-OR-converting-the-values-to-positive/m-p/419225#M7331</link>
      <description>&lt;P&gt;whups forgot the other part.  If there is a way to graph negative numbers I'd do that as well&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2018 17:39:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Graphing-negative-values-OR-converting-the-values-to-positive/m-p/419225#M7331</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2018-05-25T17:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: Graphing negative values OR converting the values to positive</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Graphing-negative-values-OR-converting-the-values-to-positive/m-p/419226#M7332</link>
      <description>&lt;P&gt;Most eval functions doesn't work on multivalued fields, which your rssid field is. Also, you can't chart the multivalued field. So in order to apply the functions or charting, you'd expand your multivalued field as single value using mvexpand command. There is no special processing to chart the negative numbers.&lt;/P&gt;

&lt;P&gt;Now if you've more than one, related multivalued fields, you'll concatenate them into single multivalued field using mvzip, expand it using mvexpand and then split it again, similar to what's being done in this post&lt;BR /&gt;
&lt;A href="http://www.bbosearch.com/commands/mvexpand"&gt;http://www.bbosearch.com/commands/mvexpand&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/301140/how-can-i-use-the-eval-function-mvzip-with-8-attri.html"&gt;https://answers.splunk.com/answers/301140/how-can-i-use-the-eval-function-mvzip-with-8-attri.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2018 18:11:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Graphing-negative-values-OR-converting-the-values-to-positive/m-p/419226#M7332</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-05-25T18:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: Graphing negative values OR converting the values to positive</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Graphing-negative-values-OR-converting-the-values-to-positive/m-p/419227#M7333</link>
      <description>&lt;P&gt;@dbcase, while negative values can definitely be plotted on charts like column, bar, line or area, it is unclear what is the aggregation field against which you want to plot the negative rssids. You seem to have two rows in your screenshot. What is the key field for each row?&lt;/P&gt;

&lt;P&gt;Try adding the following query to your existing search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=-4hr index="camera_status" sourcetype=access_combined_camerastatus 8773
|rex max_match=0 "Premise=\s+(?&amp;lt;premiseid&amp;gt;\d+)"
|rex max_match=0 "Mac=\s+(?&amp;lt;macid&amp;gt;[a-fA-F0-9\.:-]{12,17})"
|rex max_match=0 "RSSI=\s+(?&amp;lt;rssiid&amp;gt;[^\s]+)"
|  mvexpand rssiid
|  chart values(rssiid) by sno rssiid
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is a run anywhere example for you to try out:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|  makeresults
|  eval sno=1, rssiid="-12,-32,-21,-45,-9"
|  append 
    [|  makeresults
    | eval sno=2, rssiid="-43,-53,-2,-22" ]
|  makemv rssiid delim=","
|  mvexpand rssiid
|  chart values(rssiid) by sno rssiid
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 May 2018 19:22:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Graphing-negative-values-OR-converting-the-values-to-positive/m-p/419227#M7333</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-25T19:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: Graphing negative values OR converting the values to positive</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Graphing-negative-values-OR-converting-the-values-to-positive/m-p/419228#M7334</link>
      <description>&lt;P&gt;ah ok that helped, still getting some odd behavior.  I'll open up a new question&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 15:30:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Graphing-negative-values-OR-converting-the-values-to-positive/m-p/419228#M7334</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2018-05-29T15:30:06Z</dc:date>
    </item>
  </channel>
</rss>

