<?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: Capturing multiple values and creating table from results - MVexpand? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Capturing-multiple-values-and-creating-table-from-results/m-p/385770#M112637</link>
    <description>&lt;P&gt;My pleasure Barty!  Happy Splunking!&lt;/P&gt;</description>
    <pubDate>Thu, 20 Sep 2018 13:07:43 GMT</pubDate>
    <dc:creator>damiensurat</dc:creator>
    <dc:date>2018-09-20T13:07:43Z</dc:date>
    <item>
      <title>Capturing multiple values and creating table from results - MVexpand?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Capturing-multiple-values-and-creating-table-from-results/m-p/385765#M112632</link>
      <description>&lt;P&gt;Good afternoon guys &amp;amp; gals,&lt;/P&gt;

&lt;P&gt;This on paper is a simple one, but it's absolutely escaping me. We have been asked to extract the most recent 3 entries for 2 different types of quote and then the data values that follow. The data looks like this:-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;date=19-09-2018 startTime=00-00 endTime=01-00
 BI_FEED=Direct_DataFeed_20180918204501 QUOTE_TRANSACTIONS=53412 PROCESSING_TIME_SEC=987.504327 PROCESSING_STATE=complete
 BI_FEED=Direct_DataFeed_20180918213001 QUOTE_TRANSACTIONS=50096 PROCESSING_TIME_SEC=920.179029 PROCESSING_STATE=complete
 BI_FEED=CQ_DataFeed_201809190016 QUOTE_TRANSACTIONS=24 PROCESSING_TIME_SEC=54.824542 PROCESSING_STATE=complete
 BI_FEED=Direct_DataFeed_20180918204345 QUOTE_TRANSACTIONS=52312 PROCESSING_TIME_SEC=978.504327 PROCESSING_STATE=complete
 BI_FEED=CQ_DataFeed_201809190031 QUOTE_TRANSACTIONS=28 PROCESSING_TIME_SEC=65.140814 PROCESSING_STATE=complete
 BI_FEED=CQ_DataFeed_201809190045 QUOTE_TRANSACTIONS=196 PROCESSING_TIME_SEC=235.348442 PROCESSING_STATE=complete
 BI_FEED=CQ_DataFeed_201809190043 QUOTE_TRANSACTIONS=324 PROCESSING_TIME_SEC=355.376033 PROCESSING_STATE=complete
 BI_FEED=CQ_DataFeed_201809190049 QUOTE_TRANSACTIONS=188 PROCESSING_TIME_SEC=198.883841 PROCESSING_STATE=complete
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So they would like the 3 recent Direct quotes and the most recent CQ quotes. Then, they would like to table to quote ID, the transaction number and the processing time. So far, I have been testing with simply getting the data for the Direct feed, but uncoupling the data is killing me. My thought process is as follows:-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search here earliest=-15m@m
| rex max_match=3 field=_raw "BI_FEED=Direct_DataFeed_(?&amp;lt;dir&amp;gt;[0-9]*)\sQUOTE_TRANSACTIONS=(?&amp;lt;qt&amp;gt;[0-9]*)\sPROCESSING_TIME_SEC=(?&amp;lt;pts&amp;gt;[0-9.]*)"
| mvexpand dir
| table dir, qt, pts
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This produces, as expected, a separate entry per dir value but then inputs all 3 entries for the qt and pts values. Obviously this is because I need to separate them out and keep them per quote string, but I'm struggling with that! If anyone is able to assist me in the above it would be much appreciated. Remember that I need to do this for both the direct and CQ values in a single table.&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;

&lt;P&gt;Oh, and running splunk 6.6.4&lt;/P&gt;</description>
      <pubDate>Wed, 19 Sep 2018 11:14:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Capturing-multiple-values-and-creating-table-from-results/m-p/385765#M112632</guid>
      <dc:creator>Barty</dc:creator>
      <dc:date>2018-09-19T11:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: Capturing multiple values and creating table from results - MVexpand?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Capturing-multiple-values-and-creating-table-from-results/m-p/385766#M112633</link>
      <description>&lt;P&gt;Hi. I think you should refer to using the mvzip command with Rex:&lt;/P&gt;

&lt;P&gt;source="mvexpandData.csv"&lt;BR /&gt;
| rex field=_raw "a=(?\d+)" max_match=5 &lt;BR /&gt;
| rex field=_raw "b=(?&lt;B&gt;\d+)" max_match=5 &lt;BR /&gt;
| eval fields = mvzip(a,b) &lt;BR /&gt;
| mvexpand fields &lt;BR /&gt;
| rex field=fields "(?\d+),(?\d+)" &lt;BR /&gt;
| table _time alpha beta&lt;/B&gt;&lt;/P&gt;

&lt;P&gt;Check out this link:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.3/SearchReference/Mvexpand" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/7.1.3/SearchReference/Mvexpand&lt;/A&gt;&lt;BR /&gt;
&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:20:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Capturing-multiple-values-and-creating-table-from-results/m-p/385766#M112633</guid>
      <dc:creator>damiensurat</dc:creator>
      <dc:date>2020-09-29T21:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: Capturing multiple values and creating table from results - MVexpand?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Capturing-multiple-values-and-creating-table-from-results/m-p/385767#M112634</link>
      <description>&lt;P&gt;@barty&lt;/P&gt;

&lt;P&gt;Did you get a chance to try @daminesurat 's idea out? If it worked, would you go ahead and accept his answer? If not, would you let us know why it didn't work? Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 19 Sep 2018 18:14:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Capturing-multiple-values-and-creating-table-from-results/m-p/385767#M112634</guid>
      <dc:creator>mstjohn_splunk</dc:creator>
      <dc:date>2018-09-19T18:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: Capturing multiple values and creating table from results - MVexpand?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Capturing-multiple-values-and-creating-table-from-results/m-p/385768#M112635</link>
      <description>&lt;P&gt;Good morning, I am taking a look into this this morning, thank you in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 08:00:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Capturing-multiple-values-and-creating-table-from-results/m-p/385768#M112635</guid>
      <dc:creator>Barty</dc:creator>
      <dc:date>2018-09-20T08:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Capturing multiple values and creating table from results - MVexpand?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Capturing-multiple-values-and-creating-table-from-results/m-p/385769#M112636</link>
      <description>&lt;P&gt;Worked like a charm!! Thanks for that, much appreciated&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 09:41:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Capturing-multiple-values-and-creating-table-from-results/m-p/385769#M112636</guid>
      <dc:creator>Barty</dc:creator>
      <dc:date>2018-09-20T09:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Capturing multiple values and creating table from results - MVexpand?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Capturing-multiple-values-and-creating-table-from-results/m-p/385770#M112637</link>
      <description>&lt;P&gt;My pleasure Barty!  Happy Splunking!&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 13:07:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Capturing-multiple-values-and-creating-table-from-results/m-p/385770#M112637</guid>
      <dc:creator>damiensurat</dc:creator>
      <dc:date>2018-09-20T13:07:43Z</dc:date>
    </item>
  </channel>
</rss>

