<?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: result in single row in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/result-in-single-row/m-p/582129#M202780</link>
    <description>&lt;P&gt;thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/190794"&gt;@johnhuang&lt;/a&gt;&amp;nbsp; it worked.&lt;/P&gt;</description>
    <pubDate>Sat, 22 Jan 2022 07:58:57 GMT</pubDate>
    <dc:creator>roopeshetty</dc:creator>
    <dc:date>2022-01-22T07:58:57Z</dc:date>
    <item>
      <title>result in single row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/result-in-single-row/m-p/582113#M202774</link>
      <description>&lt;P&gt;Hi Guys&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a query like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;query&amp;gt;| stats avg(CurrentConnections) as CC by host&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the output is as below with multiple rows&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="roopeshetty_0-1642822724701.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/17654iFDAF97245E6FBBA2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="roopeshetty_0-1642822724701.png" alt="roopeshetty_0-1642822724701.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But we have a requirement to get all the results in a single row (all outputs are required but in a single row instead of multiple rows one after one) some thing like this;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="312"&gt;&lt;P&gt;host&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD width="312"&gt;&lt;P&gt;CC&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="312"&gt;&lt;P&gt;server01&lt;/P&gt;&lt;P&gt;server02&lt;/P&gt;&lt;P&gt;server03&lt;/P&gt;&lt;P&gt;server04&lt;/P&gt;&lt;P&gt;server05&lt;/P&gt;&lt;P&gt;server06&lt;/P&gt;&lt;/TD&gt;&lt;TD width="312"&gt;&lt;P&gt;368.333333333333&lt;/P&gt;&lt;P&gt;365.333333333333&lt;/P&gt;&lt;P&gt;345.333333333333&lt;/P&gt;&lt;P&gt;379.666666666666&lt;/P&gt;&lt;P&gt;356.333333333333&lt;/P&gt;&lt;P&gt;381.666666666666&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone please guide us how to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jan 2022 03:41:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/result-in-single-row/m-p/582113#M202774</guid>
      <dc:creator>roopeshetty</dc:creator>
      <dc:date>2022-01-22T03:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: result in single row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/result-in-single-row/m-p/582123#M202777</link>
      <description>&lt;P&gt;&amp;lt;query&amp;gt;&lt;BR /&gt;| stats avg(CurrentConnections) as CC by host&amp;nbsp;&lt;BR /&gt;| stats list(host) AS host list(CC) AS CC&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jan 2022 06:46:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/result-in-single-row/m-p/582123#M202777</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2022-01-22T06:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: result in single row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/result-in-single-row/m-p/582129#M202780</link>
      <description>&lt;P&gt;thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/190794"&gt;@johnhuang&lt;/a&gt;&amp;nbsp; it worked.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jan 2022 07:58:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/result-in-single-row/m-p/582129#M202780</guid>
      <dc:creator>roopeshetty</dc:creator>
      <dc:date>2022-01-22T07:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: result in single row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/result-in-single-row/m-p/582148#M202787</link>
      <description>&lt;P&gt;One big caveat though. Remember that list() doesn't care about "continuity" of entries before merging them. So if you have empty results (in your example - hosts without connections), you'll get "wrong" results.&lt;/P&gt;&lt;P&gt;Compare results of&lt;/P&gt;&lt;PRE&gt;| makeresults annotate=f count=100 &lt;BR /&gt;| streamstats count &lt;BR /&gt;| table count &lt;BR /&gt;| eval value=if(count%10!=3,count,null())&lt;BR /&gt;| stats avg(value) as avg by count&lt;/PRE&gt;&lt;P&gt;with&lt;/P&gt;&lt;PRE&gt;| makeresults annotate=f count=100 &lt;BR /&gt;| streamstats count &lt;BR /&gt;| table count &lt;BR /&gt;| eval value=if(count%10!=3,count,null())&lt;BR /&gt;| stats avg(value) as avg by count&lt;BR /&gt;| stats list(avg) list(count)&lt;/PRE&gt;&lt;P&gt;You could use fillnull to fill the "gaps"&lt;/P&gt;&lt;PRE&gt;| makeresults annotate=f count=100 &lt;BR /&gt;| streamstats count &lt;BR /&gt;| table count &lt;BR /&gt;| eval value=if(count%10!=3,count,null())&lt;BR /&gt;| stats avg(value) as avg by count&lt;BR /&gt;| fillnull value="N/A"&lt;BR /&gt;| stats list(avg) list(count)&lt;/PRE&gt;&lt;P&gt;But in general - it's best to avoid operating on such formed multivalue fields and don't rely on the order of values of those fields.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jan 2022 17:26:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/result-in-single-row/m-p/582148#M202787</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-01-22T17:26:41Z</dc:date>
    </item>
  </channel>
</rss>

