<?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 Saved search table value as array for multi-valued search to a new table in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Saved-search-table-value-as-array-for-multi-valued-search-to-a/m-p/302574#M3899</link>
    <description>&lt;P&gt;Hello I am doing a search that results in a table with these values... "| table _time, recState, context, message.connID, message.timeStamp.timeinSecs, message.agentID, message.aNI, host"&lt;/P&gt;

&lt;P&gt;The issue is that I need to know durations which is not captured in the events. But I can do... "index=abc sourcetype=xyz message.connID | stats range(_time) as difference". Which provides an individual view of the events with this one unique ID and provides overall event duration.&lt;/P&gt;

&lt;P&gt;I am trying to find a way to use the initial table as array values, run multiple searches like the one above, to produce a new table where each row has all the table columns and a new column for "duration" based one each unique message.connID.&lt;/P&gt;</description>
    <pubDate>Sun, 27 Aug 2017 15:17:21 GMT</pubDate>
    <dc:creator>jsleona</dc:creator>
    <dc:date>2017-08-27T15:17:21Z</dc:date>
    <item>
      <title>Saved search table value as array for multi-valued search to a new table</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Saved-search-table-value-as-array-for-multi-valued-search-to-a/m-p/302574#M3899</link>
      <description>&lt;P&gt;Hello I am doing a search that results in a table with these values... "| table _time, recState, context, message.connID, message.timeStamp.timeinSecs, message.agentID, message.aNI, host"&lt;/P&gt;

&lt;P&gt;The issue is that I need to know durations which is not captured in the events. But I can do... "index=abc sourcetype=xyz message.connID | stats range(_time) as difference". Which provides an individual view of the events with this one unique ID and provides overall event duration.&lt;/P&gt;

&lt;P&gt;I am trying to find a way to use the initial table as array values, run multiple searches like the one above, to produce a new table where each row has all the table columns and a new column for "duration" based one each unique message.connID.&lt;/P&gt;</description>
      <pubDate>Sun, 27 Aug 2017 15:17:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Saved-search-table-value-as-array-for-multi-valued-search-to-a/m-p/302574#M3899</guid>
      <dc:creator>jsleona</dc:creator>
      <dc:date>2017-08-27T15:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Saved search table value as array for multi-valued search to a new table</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Saved-search-table-value-as-array-for-multi-valued-search-to-a/m-p/302575#M3900</link>
      <description>&lt;P&gt;@jsleona - If you had given us the entire original search, then we could provide a complete solution.  I have provided a solution below that uses your given table to get the rest, but it would be much more efficient to get it all in a single pass at the data.&lt;/P&gt;

&lt;P&gt;For instance, here's a way to get all the differences, by themselves, at the same time...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=abc sourcetype=xyz   [your search that gets all that stuff | table message.connID]
| stats range(_time) as difference by message.connID 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...and here's a way to get it after your existing search and attach it to your existing search...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; your search that gets all this stuff
 | table _time, recState, context, message.connID, message.timeStamp.timeinSecs, message.agentID, message.aNI, host
 | appendpipe 
     [| table message.connID 
      | format 
      | rename search as mysearch 
      | map search="search index=abc sourcetype=xyz $mysearch$ 
      | stats range(_time) as difference by message.connID 
      ]
 | eventstats max(difference) as difference by message.connID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;... however, while that method will almost certainly work, it is also almost certainly not the most efficient way.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2017 05:32:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Saved-search-table-value-as-array-for-multi-valued-search-to-a/m-p/302575#M3900</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-08-28T05:32:24Z</dc:date>
    </item>
  </channel>
</rss>

