<?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: Chart multiple columns based on time and additional grouping in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Chart-multiple-columns-based-on-time-and-additional-grouping/m-p/216555#M63543</link>
    <description>&lt;P&gt;This is an example of what the original query returns:&lt;/P&gt;

&lt;P&gt;Device        Point_Name-D               Point_Name-B                Point_Name-C             difference&lt;BR /&gt;
Dev_1                                                  57.53                                  55                           2.53&lt;BR /&gt;
Dev_2                                                  57.25                                  55                           2.25&lt;BR /&gt;
Dev_3                                                  58.01                                  55                           3.01&lt;BR /&gt;
Dev_4                                                  77.71                                  58                         19.71&lt;BR /&gt;
Dev_5                                                  64.12                                  58                           6.12&lt;/P&gt;

&lt;P&gt;The format here is ideal for what we are trying to achieve, but we also need the "_time" field appended as well. I have tried replicating this in a timechart query with a span=15m variable, but that was not printing out what we needed. Since not all these records are coming in at the same moment, I thought the "timechart span=15m" would give us a nicely rounded _time field to work work for writing to the summary index.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 10:32:56 GMT</pubDate>
    <dc:creator>tccooper</dc:creator>
    <dc:date>2020-09-29T10:32:56Z</dc:date>
    <item>
      <title>Chart multiple columns based on time and additional grouping</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-multiple-columns-based-on-time-and-additional-grouping/m-p/216553#M63541</link>
      <description>&lt;P&gt;We are trying to chart multiple results with some success. I am able to have everything sorted based off the &lt;CODE&gt;Device&lt;/CODE&gt; correctly. My issue is this is going in a &lt;CODE&gt;summary index&lt;/CODE&gt; and I need to include the &lt;CODE&gt;timestamp&lt;/CODE&gt; so we can have accurate results of when everything broke. Here is the existing query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="XXXXXXXXXX" Device="*AAAAA*" Point_Name="BBBBBB" OR Point_Name="CCCCC" OR Point_Name="DDDDD"|chart limit=0 last(Value) over Device by Point_Name|eval difference = if(isnull(CCCCC),(AAAAA-DDDDD),(AAAAA-CCCCC))|where difference &amp;gt; 2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This gives me once record per &lt;CODE&gt;Device&lt;/CODE&gt; where the &lt;CODE&gt;difference&lt;/CODE&gt; is greater then &lt;CODE&gt;2&lt;/CODE&gt;. However, I know there are multiple times throughout the day where this condition is broken. I need to sort out each record so we can count the number of consecutive 15 minute windows that this query returns results based on &lt;CODE&gt;Device&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Thanks in advance for help.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2016 12:56:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-multiple-columns-based-on-time-and-additional-grouping/m-p/216553#M63541</guid>
      <dc:creator>tccooper</dc:creator>
      <dc:date>2016-08-09T12:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Chart multiple columns based on time and additional grouping</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-multiple-columns-based-on-time-and-additional-grouping/m-p/216554#M63542</link>
      <description>&lt;P&gt;Not quite sure I understand what you're trying to achieve, but see if this helps&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="XXXXXXXXXX" Device="AAAAA" Point_Name="BBBBBB" OR Point_Name="CCCCC" OR Point_Name="DDDDD"|chart limit=0 values(Value) as Value over Device by Point_Name|mvexpand Value |eval diff=AAAAA-coalesce(CCCC, DDDDD) | where diff&amp;gt;2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Aug 2016 13:28:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-multiple-columns-based-on-time-and-additional-grouping/m-p/216554#M63542</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-09T13:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Chart multiple columns based on time and additional grouping</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-multiple-columns-based-on-time-and-additional-grouping/m-p/216555#M63543</link>
      <description>&lt;P&gt;This is an example of what the original query returns:&lt;/P&gt;

&lt;P&gt;Device        Point_Name-D               Point_Name-B                Point_Name-C             difference&lt;BR /&gt;
Dev_1                                                  57.53                                  55                           2.53&lt;BR /&gt;
Dev_2                                                  57.25                                  55                           2.25&lt;BR /&gt;
Dev_3                                                  58.01                                  55                           3.01&lt;BR /&gt;
Dev_4                                                  77.71                                  58                         19.71&lt;BR /&gt;
Dev_5                                                  64.12                                  58                           6.12&lt;/P&gt;

&lt;P&gt;The format here is ideal for what we are trying to achieve, but we also need the "_time" field appended as well. I have tried replicating this in a timechart query with a span=15m variable, but that was not printing out what we needed. Since not all these records are coming in at the same moment, I thought the "timechart span=15m" would give us a nicely rounded _time field to work work for writing to the summary index.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:32:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-multiple-columns-based-on-time-and-additional-grouping/m-p/216555#M63543</guid>
      <dc:creator>tccooper</dc:creator>
      <dc:date>2020-09-29T10:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: Chart multiple columns based on time and additional grouping</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-multiple-columns-based-on-time-and-additional-grouping/m-p/216556#M63544</link>
      <description>&lt;P&gt;Try &lt;CODE&gt;bin&lt;/CODE&gt; &amp;amp; &lt;CODE&gt;stats&lt;/CODE&gt;. Something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="XXXXXXXXXX" Device="AAAAA" Point_Name="BBBBBB" OR Point_Name="CCCCC" OR Point_Name="DDDDD"| bin span=15m _time | stats latest(Value) as Value by DeviceId Point |eval diff=AAAAA-coalesce(CCCC, DDDDD) | eval td=_time."#".DeviceId | xyseries td Point Value | rex field=td "(?&amp;lt;time&amp;gt;[^#]+)#(?&amp;lt;Device&amp;gt;.*)" | fields - td
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Aug 2016 14:47:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-multiple-columns-based-on-time-and-additional-grouping/m-p/216556#M63544</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-09T14:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Chart multiple columns based on time and additional grouping</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-multiple-columns-based-on-time-and-additional-grouping/m-p/216557#M63545</link>
      <description>&lt;P&gt;&lt;STRONG&gt;NOT TESTED&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Have you tried with bucket and stats instead?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="XXXXXXXXXX" Device="AAAAA" Point_Name="BBBBBB" OR Point_Name="CCCCC" OR Point_Name="DDDDD"
| bucket _time span=15m
| stats last(Value) by Device, Point_Name, _time
| eval difference = if(isnull(CCCCC),(AAAAA-DDDDD),(AAAAA-CCCCC))
| where difference &amp;gt; 2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then maybe if you need the format back in the same way as chart use xyseries for instance.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2016 14:51:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-multiple-columns-based-on-time-and-additional-grouping/m-p/216557#M63545</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-08-09T14:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: Chart multiple columns based on time and additional grouping</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-multiple-columns-based-on-time-and-additional-grouping/m-p/216558#M63546</link>
      <description>&lt;P&gt;Here is the query that was the "money maker":&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="XXXXX" Device="*YYYYY*" Point_Name="aaaaa"
        |bin span=15m _time
        |stats last(Value) as AAAAA by Device, _time
        |appendcols [|search index="XXXXX" Device="*YYYYY*" Point_Name="bbbbb" |bin span=15m _time |stats last(Value) as BBBBB by Device, _time ]
        |appendcols [|search index="XXXXX" Device="*YYYYY*" Point_Name="ccccc" |bin span=15m _time |stats last(Value) as CCCCC by Device, _time ]
        |eval DDDDD = coalesce(BBBBB, CCCCC)
        |eval difference = (AAAAA - DDDDD)
        |where difference &amp;gt; 2
        |fields _time, Device, difference
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Aug 2016 18:12:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-multiple-columns-based-on-time-and-additional-grouping/m-p/216558#M63546</guid>
      <dc:creator>tccooper</dc:creator>
      <dc:date>2016-08-09T18:12:12Z</dc:date>
    </item>
  </channel>
</rss>

