<?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: Need help with below Query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-below-Query/m-p/491601#M137229</link>
    <description>&lt;P&gt;Thanks guys.&lt;/P&gt;

&lt;P&gt;All the above suggestions are  working on this sample data.&lt;BR /&gt;
But the first suggestion by @to4kawa worked for my actual data.&lt;/P&gt;

&lt;P&gt;The data was in text format only not sure, why other two was not working.&lt;/P&gt;

&lt;P&gt;Once again,  thanks a lot for your suggestions&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Nilesh&lt;/P&gt;</description>
    <pubDate>Tue, 17 Mar 2020 06:45:08 GMT</pubDate>
    <dc:creator>nilbak1</dc:creator>
    <dc:date>2020-03-17T06:45:08Z</dc:date>
    <item>
      <title>Need help with below Query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-below-Query/m-p/491597#M137225</link>
      <description>&lt;P&gt;I am running below Query&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| makeresults| eval data="Brand1,File1,123;Brand1,File2,456;Brand2,File1,789;Brand2,File2,124;Brand3,File1,125;Brand3,File2,786"| makemv data delim=";" | rex field=data max_match=0 "(?&amp;lt;Brand&amp;gt;\w+\d+),(?&amp;lt;Files&amp;gt;\w+\d+)\,(?&amp;lt;Size&amp;gt;\d+)" | fields - _time,data | table Brand,Size,Files| chart values(Size) over Files by Brand&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;And want result in below format&lt;/P&gt;

&lt;P&gt;Files        Brand1       Brand2        Brand3&lt;BR /&gt;
File1       123              789               125&lt;BR /&gt;&lt;BR /&gt;
File2        456             124               786&lt;/P&gt;

&lt;P&gt;But result is coming as attached in picture. Whats wrong with the Query ?&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/8529iC6797E7109D935FB/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, 13 Mar 2020 08:01:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-below-Query/m-p/491597#M137225</guid>
      <dc:creator>nilbak1</dc:creator>
      <dc:date>2020-03-13T08:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with below Query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-below-Query/m-p/491598#M137226</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Check this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval data="Brand1,File1,123;Brand1,File2,456;Brand2,File1,789;Brand2,File2,124;Brand3,File1,125;Brand3,File2,786" 
| makemv data delim=";" 
| mvexpand data 
| rex field=data max_match=0 "(?&amp;lt;Brand&amp;gt;\w+\d+),(?&amp;lt;Files&amp;gt;\w+\d+)\,(?&amp;lt;Size&amp;gt;\d+)" 
| fields Brand,Files,Size 
| eval {Brand}=Size 
| fields - Brand, Size | stats values(*) as * by Files
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Mar 2020 08:22:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-below-Query/m-p/491598#M137226</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2020-03-13T08:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with below Query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-below-Query/m-p/491599#M137227</link>
      <description>&lt;P&gt;Indeed. Key thing here is adding the &lt;CODE&gt;| mvexpand data&lt;/CODE&gt;. Otherwise you are working with a single row, with multivalued fields, which results in the outcome as per the screenshot.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 10:53:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-below-Query/m-p/491599#M137227</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2020-03-13T10:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with below Query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-below-Query/m-p/491600#M137228</link>
      <description>&lt;P&gt;From your result:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval data="Brand1,File1,123;Brand1,File2,456;Brand2,File1,789;Brand2,File2,124;Brand3,File1,125;Brand3,File2,786" 
| makemv data delim=";" 
| rex field=data max_match=0 "(?&amp;lt;Brand&amp;gt;\w+\d+),(?&amp;lt;Files&amp;gt;\w+\d+)\,(?&amp;lt;Size&amp;gt;\d+)" 
| fields - _time,data 
| table Brand,Size,Files
| rename COMMENT as "this is your sample , From here , the logic"
| eval _counter = mvrange(0,mvcount(Brand))
| stats list(*) as * by _counter
| foreach * [ eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = mvindex('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;' , _counter)]
| xyseries Brand Files Size
| transpose 0 header_field=Brand column_name=Files
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;More efficient:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval data="Brand1,File1,123;Brand1,File2,456;Brand2,File1,789;Brand2,File2,124;Brand3,File1,125;Brand3,File2,786" 
| makemv data delim=";"
| stats count by data
| rex field=data "(?&amp;lt;Brand&amp;gt;\w+\d+),(?&amp;lt;Files&amp;gt;\w+\d+)\,(?&amp;lt;Size&amp;gt;\d+)" 
| fields - _time,data,count 
| chart sum(Size) by Files Brand
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi folks.&lt;BR /&gt;
Maybe, you want to extract these from JSON.&lt;BR /&gt;
I create two query, How about these?&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 05:20:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-below-Query/m-p/491600#M137228</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-03-15T05:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with below Query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-below-Query/m-p/491601#M137229</link>
      <description>&lt;P&gt;Thanks guys.&lt;/P&gt;

&lt;P&gt;All the above suggestions are  working on this sample data.&lt;BR /&gt;
But the first suggestion by @to4kawa worked for my actual data.&lt;/P&gt;

&lt;P&gt;The data was in text format only not sure, why other two was not working.&lt;/P&gt;

&lt;P&gt;Once again,  thanks a lot for your suggestions&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Nilesh&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2020 06:45:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-below-Query/m-p/491601#M137229</guid>
      <dc:creator>nilbak1</dc:creator>
      <dc:date>2020-03-17T06:45:08Z</dc:date>
    </item>
  </channel>
</rss>

