<?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: Splicing events with the same time stamp together in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splicing-events-with-the-same-time-stamp-together/m-p/116710#M31001</link>
    <description>&lt;P&gt;Either setup a transaction based on &lt;CODE&gt;_time&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=counts | eval count_a=case(category=1 AND type='A', count1, category=2 AND type='A', count2) | eval count_b=case(category=1 AND type='B', count3, category=2 AND type='B', count4) | transaction _time | table _time, count_a, count_b
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or for better performance, use &lt;CODE&gt;stats&lt;/CODE&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=counts | stats count(eval(category=1 AND type='A')) as count1, count(eval(category=2 AND type='A')) as count2 by _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 27 Oct 2013 07:58:47 GMT</pubDate>
    <dc:creator>Ayn</dc:creator>
    <dc:date>2013-10-27T07:58:47Z</dc:date>
    <item>
      <title>Splicing events with the same time stamp together</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splicing-events-with-the-same-time-stamp-together/m-p/116709#M31000</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a weird data structure I'm trying to figure out a better way to handle. The data I'm getting uses category and type fields to tell me what the counts mean. Right now its set up to work something like this, where I do a fair amount of logic to get the counts I want. (but there are actually a lot more categories, types, and logic):&lt;/P&gt;

&lt;P&gt;index=counts &lt;BR /&gt;
    | eval count_a=case(category=1 AND type='A', count1, category=2 AND type='A', count2) &lt;BR /&gt;
    | eval count_b=case(category=1 AND type='B', count3, category=2 AND type='B', count4)&lt;BR /&gt;
    | table _time, count_a, count_b&lt;/P&gt;

&lt;P&gt;This gives me results like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;     _time,                      count_a,    count_b
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;1   10/26/13 8:15:00.201 PM,       [BLANK],    50&lt;/P&gt;

&lt;P&gt;2   10/26/13 8:15:00.201 PM,       65,       [BLANK]&lt;/P&gt;

&lt;P&gt;3   10/26/13 8:00:00.201 PM,       [BLANK] ,      43&lt;/P&gt;

&lt;P&gt;4   10/26/13 8:00:00.201 PM,       78,       BLANK]....&lt;/P&gt;

&lt;P&gt;The [BLANK]s are literally blank, because not every line if the file has data for each type of count I'm interested in. After all the logic I have count fields for all the counts and every time step has a value for each count, but they are split over multiple lines. Is there a way to combine them so that I can get table with out blanks in it? Like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;     _time,                      count_a,    count_b
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;1   10/26/13 8:15:00.201 PM,       65,    50&lt;/P&gt;

&lt;P&gt;2   10/26/13 8:00:00.201 PM,       78 ,      43....&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Tristan&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:05:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splicing-events-with-the-same-time-stamp-together/m-p/116709#M31000</guid>
      <dc:creator>tristanmatthews</dc:creator>
      <dc:date>2020-09-28T15:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: Splicing events with the same time stamp together</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splicing-events-with-the-same-time-stamp-together/m-p/116710#M31001</link>
      <description>&lt;P&gt;Either setup a transaction based on &lt;CODE&gt;_time&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=counts | eval count_a=case(category=1 AND type='A', count1, category=2 AND type='A', count2) | eval count_b=case(category=1 AND type='B', count3, category=2 AND type='B', count4) | transaction _time | table _time, count_a, count_b
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or for better performance, use &lt;CODE&gt;stats&lt;/CODE&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=counts | stats count(eval(category=1 AND type='A')) as count1, count(eval(category=2 AND type='A')) as count2 by _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 27 Oct 2013 07:58:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splicing-events-with-the-same-time-stamp-together/m-p/116710#M31001</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-10-27T07:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Splicing events with the same time stamp together</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splicing-events-with-the-same-time-stamp-together/m-p/116711#M31002</link>
      <description>&lt;P&gt;ok I fell silly, transaction was the first thing I tried, but clearly I miss read it.&lt;/P&gt;</description>
      <pubDate>Sun, 27 Oct 2013 19:29:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splicing-events-with-the-same-time-stamp-together/m-p/116711#M31002</guid>
      <dc:creator>tristanmatthews</dc:creator>
      <dc:date>2013-10-27T19:29:23Z</dc:date>
    </item>
  </channel>
</rss>

