<?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 Create a table with diferent values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-diferent-values/m-p/377378#M110721</link>
    <description>&lt;P&gt;Hi, &lt;BR /&gt;
I need to create or design the following table.&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/6298iE6588B25D6CBAA83/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;Is posible in Splunk Enterprise?&lt;/P&gt;</description>
    <pubDate>Tue, 18 Dec 2018 18:59:18 GMT</pubDate>
    <dc:creator>Carolina</dc:creator>
    <dc:date>2018-12-18T18:59:18Z</dc:date>
    <item>
      <title>Create a table with diferent values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-diferent-values/m-p/377378#M110721</link>
      <description>&lt;P&gt;Hi, &lt;BR /&gt;
I need to create or design the following table.&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/6298iE6588B25D6CBAA83/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;Is posible in Splunk Enterprise?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 18:59:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-diferent-values/m-p/377378#M110721</guid>
      <dc:creator>Carolina</dc:creator>
      <dc:date>2018-12-18T18:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table with diferent values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-diferent-values/m-p/377379#M110722</link>
      <description>&lt;P&gt;Can you show the sample dataset ? This type of result is possible with the use of commands like &lt;CODE&gt;chart&lt;/CODE&gt; along with &lt;CODE&gt;append&lt;/CODE&gt; or &lt;CODE&gt;join&lt;/CODE&gt; but again depends on how your data is coming into Splunk. &lt;CODE&gt;totals&lt;/CODE&gt; can be calculated using &lt;CODE&gt;addtotals&lt;/CODE&gt; &lt;CODE&gt;addcoltotals&lt;/CODE&gt; etc. &lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 19:05:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-diferent-values/m-p/377379#M110722</guid>
      <dc:creator>macadminrohit</dc:creator>
      <dc:date>2018-12-18T19:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table with diferent values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-diferent-values/m-p/377380#M110723</link>
      <description>&lt;P&gt;Splunk doesn't support multiline column headers, so you'd basically have to merge those two values into single field and that use in your chart or any aggregation command. More accurate suggestions can be given if you could share your sample data/search.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 19:47:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-diferent-values/m-p/377380#M110723</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-12-18T19:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table with diferent values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-diferent-values/m-p/377381#M110724</link>
      <description>&lt;P&gt;Yes, you can do that.  You just need to move the month name into the name of the fields.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;concepto   enero val1  enero val2  enero val3  enero val4  enero total  febrero val1  febrero val2 ... etc
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, the business need can probably be solved more completely by reviewing how the user is going to use that information.  It's not very easy in that report format to compare the results from, say, January to the results from April. Presenting the results as numbers doesn't seem to be the best way.  &lt;/P&gt;

&lt;P&gt;Consider using a dashboard with a trellis.  You have three dimensions (month, test, and value) and a count for each combination.  A trellis with a stacked bar chart for each value in a month, split out by test, seems like it would produce more information on how your values were changing over time for each test.   &lt;/P&gt;

&lt;P&gt;Take this run-anywhere sample, and set the visualization as a stacked bar chart, with the trellis set to use "Month" as its split-by field, and you will see what I mean.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval mydata="01,prueba1,45,21,65,27!!!!02,prueba1,47,21,63,27!!!!03,prueba1,41,25,65,27!!!!04,prueba1,45,21,65,27!!!!01,prueba2,45,21,65,27!!!!02,prueba2,45,21,65,27!!!!03,prueba2,45,21,65,27!!!!04,prueba2,45,21,65,27"|makemv mydata delim="!!!!"| mvexpand mydata 
| rex field=mydata "(?&amp;lt;month&amp;gt;\d+),(?&amp;lt;test&amp;gt;[^,]+),(?&amp;lt;val1&amp;gt;[^,]+),(?&amp;lt;val2&amp;gt;[^,]+),(?&amp;lt;val3&amp;gt;[^,]+),(?&amp;lt;val4&amp;gt;[^,]+)"
| eval Month="2019-".month
| stats sum(va*) as va* by Month test 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then switch to use test as the split-by field, for comparison.  You might also consider an area chart as a possible viz for this, instead fo the stacked bar charts.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jan 2019 18:24:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-diferent-values/m-p/377381#M110724</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2019-01-02T18:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table with diferent values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-diferent-values/m-p/377382#M110725</link>
      <description>&lt;P&gt;This is the best that you can do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval raw="time=1/1/2018,Concepto=prueba01,Value1=45,Value2=21,Value3=25,Value4=67 time=2/1/2018,Concepto=prueba01,Value1=45,Value2=21,Value3=25,Value4=67 time=3/1/2018,Concepto=prueba01,Value1=45,Value2=21,Value3=25,Value4=67 time=4/1/2018,Concepto=prueba01,Value1=45,Value2=21,Value3=25,Value4=67 time=1/1/2018,Concepto=prueba02,Value1=45,Value2=21,Value3=25,Value4=67 time=2/1/2018,Concepto=prueba02,Value1=45,Value2=21,Value3=25,Value4=67 time=3/1/2018,Concepto=prueba02,Value1=45,Value2=21,Value3=25,Value4=67 time=4/1/2018,Concepto=prueba02,Value1=45,Value2=21,Value3=25,Value4=67 time=1/1/2018,Concepto=prueba03,Value1=45,Value2=21,Value3=25,Value4=67 time=2/1/2018,Concepto=prueba03,Value1=45,Value2=21,Value3=25,Value4=67 time=3/1/2018,Concepto=prueba03,Value1=45,Value2=21,Value3=25,Value4=67 time=4/1/2018,Concepto=prueba03,Value1=45,Value2=21,Value3=25,Value4=67 time=1/1/2018,Concepto=prueba04,Value1=45,Value2=21,Value3=25,Value4=67 time=2/1/2018,Concepto=prueba04,Value1=45,Value2=21,Value3=25,Value4=67 time=3/1/2018,Concepto=prueba04,Value1=45,Value2=21,Value3=25,Value4=67 time=4/1/2018,Concepto=prueba04,Value1=45,Value2=21,Value3=25,Value4=67 time=1/1/2018,Concepto=prueba05,Value1=45,Value2=21,Value3=25,Value4=67 time=2/1/2018,Concepto=prueba05,Value1=45,Value2=21,Value3=25,Value4=67 time=3/1/2018,Concepto=prueba05,Value1=45,Value2=21,Value3=25,Value4=67 time=4/1/2018,Concepto=prueba05,Value1=45,Value2=21,Value3=25,Value4=67 time=1/1/2018,Concepto=prueba06,Value1=45,Value2=21,Value3=25,Value4=67 time=2/1/2018,Concepto=prueba06,Value1=45,Value2=21,Value3=25,Value4=67 time=3/1/2018,Concepto=prueba06,Value1=45,Value2=21,Value3=25,Value4=67 time=4/1/2018,Concepto=prueba06,Value1=45,Value2=21,Value3=25,Value4=67 time=1/1/2018,Concepto=prueba07,Value1=45,Value2=21,Value3=25,Value4=67 time=2/1/2018,Concepto=prueba07,Value1=45,Value2=21,Value3=25,Value4=67 time=3/1/2018,Concepto=prueba07,Value1=45,Value2=21,Value3=25,Value4=67 time=4/1/2018,Concepto=prueba07,Value1=45,Value2=21,Value3=25,Value4=67 time=1/1/2018,Concepto=prueba08,Value1=45,Value2=21,Value3=25,Value4=67 time=2/1/2018,Concepto=prueba08,Value1=45,Value2=21,Value3=25,Value4=67 time=3/1/2018,Concepto=prueba08,Value1=45,Value2=21,Value3=25,Value4=67 time=4/1/2018,Concepto=prueba08,Value1=45,Value2=21,Value3=25,Value4=67"
| makemv raw
| mvexpand raw
| rename raw AS _raw
| kv
| eval _time = strptime(time, "%m/%d/%Y")
| fields - time

| rename COMMENT AS "Everything above generates sample event data; everything below is your solution."

| bin _time span=1mon
| stats sum(Val*) AS Val* BY Concepto _time
| addtotals Value* fieldname="ValueTotal"
| eval time = strftime(_time, "%b")
| sort 0 - _time
| streamstats dc(_time) AS spaces_count
| eval spaces_count = spaces_count - 1
| eval initialLength = len(time)
| eval time = "                                                  " . time
| eval paddedLength = len(time)
| eval time = substr(time, paddedLength - initialLength - spaces_count + 1)
| foreach Value* [ eval {time}:&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; ]
| fields - time Value*
| stats values(*) AS * BY Concepto
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Feb 2019 09:33:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-diferent-values/m-p/377382#M110725</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-02-11T09:33:09Z</dc:date>
    </item>
  </channel>
</rss>

