<?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: Help with Sideview Utils Dashboard, ValueSetter, ArrayValueSetter and running 2nd search over a list of values? in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Help-with-Sideview-Utils-Dashboard-ValueSetter-ArrayValueSetter/m-p/50826#M2812</link>
    <description>&lt;P&gt;update: the join is still pretty slow so I like the method I described in my question.&lt;/P&gt;</description>
    <pubDate>Thu, 29 Aug 2013 04:34:00 GMT</pubDate>
    <dc:creator>jpass</dc:creator>
    <dc:date>2013-08-29T04:34:00Z</dc:date>
    <item>
      <title>Help with Sideview Utils Dashboard, ValueSetter, ArrayValueSetter and running 2nd search over a list of values?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Help-with-Sideview-Utils-Dashboard-ValueSetter-ArrayValueSetter/m-p/50824#M2810</link>
      <description>&lt;P&gt;I didn't really know how to phrase this question so I just included the SideView modules I'm using.&lt;/P&gt;

&lt;P&gt;I have a set of events that have a unique identifier field. Let's call it 'refid'. Then, sometimes, the events will have a field called 'related_events' which is a multi-value field containing 'refid' values that refer to other events in the same index. &lt;/P&gt;

&lt;P&gt;So, my goal is to basically JOIN all 'related_events' to the same result set as the primary events. I tried using the JOIN command but it's pretty slow search because the JOIN search has to run over all time. &lt;/P&gt;

&lt;P&gt;Since this is in a Dashboard I can break up the process into two seaches:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Search 1 - run a search using the textfield input and get a list of refids to retrieve with search 2&lt;/STRONG&gt;&lt;BR /&gt;
index=myindex | eval refids=mvappend(refid,related_events) | mvexpand refids | stats values(refids) AS refids&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;STRONG&gt;- Search 2 - Using ResultsValueSetter, ValueSetter &amp;amp; ArrayValueSetter I create a string from the list of refids from search 1 which looks like this:&lt;/STRONG&gt;&lt;BR /&gt;
refid="123" OR refid="456" OR refid="567" OR refid="8910" etc.&lt;/P&gt;

&lt;P&gt;I really have two problems but only one is really necessary to solve right now.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Problem - How could I create a field in search two that tells me if the result is 'primary' or 'related' ?&lt;/STRONG&gt;&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;use custom javascript to parse out the ORs and ANDs and then provide the search with the values to be used with the HIGHLIGHT command&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;EDIT: Source Data Example w/ User Search Example&lt;/P&gt;

&lt;P&gt;Let's say a user does a search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex sourcetype=st1 xxxkeywordherexxx
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;_raw - these two events are returned because they contain the keyword &lt;STRONG&gt;xxxkeywordherexxx&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;timestamp: 2013-02-10 12:54:01    refid: 1234     related_events: 456 789 323     uname: fooname    summary: a bunch of text summarizing the event and users keyword search mainly this text and it has ips domains xxxkeywordherexxx

timestamp: 2012-11-01 04:51:43    refid: 0201     related_events: 320 312     uname: barname    summary: blah blah blah xxxkeywordherexxx blah blah blah
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I want is to achieve a JOIN on the multi-value field 'related_events' where each value of 'related_events' references another event's refid.&lt;/P&gt;

&lt;P&gt;So the end goal is that the search would return the initial search results with a new field detailing whether the result was primary or related depending if the event was the result of the primary search or if it was fetch because it was referenced as 'related':&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval search_type="primary" 
| eval search_type="related"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;TABLE cellpadding="15" border="1"&gt;
&lt;TBODY&gt;&lt;TR&gt;&lt;TD valign="top"&gt;2013-02-10 12:54:01&lt;/TD&gt;&lt;TD valign="top"&gt;1234&lt;/TD&gt;&lt;TD valign="top"&gt;456&lt;BR /&gt;789&lt;BR /&gt;323&lt;/TD&gt;&lt;TD valign="top"&gt;fooname&lt;/TD&gt;&lt;TD valign="top"&gt;primary&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;&lt;TD valign="top"&gt;2012-01-11 13:01:01&lt;/TD&gt;&lt;TD valign="top"&gt;456&lt;/TD&gt;&lt;TD valign="top"&gt;666&lt;/TD&gt;&lt;TD valign="top"&gt;myusername&lt;/TD&gt;&lt;TD valign="top"&gt;related&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;&lt;TD valign="top"&gt;2012-12-01 04:01:22&lt;/TD&gt;&lt;TD valign="top"&gt;789&lt;/TD&gt;&lt;TD valign="top"&gt;&lt;/TD&gt;&lt;TD valign="top"&gt;fooname&lt;/TD&gt;&lt;TD valign="top"&gt;related&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;&lt;TD valign="top"&gt;2012-12-12 15:22:12&lt;/TD&gt;&lt;TD valign="top"&gt;323&lt;/TD&gt;&lt;TD valign="top"&gt;&lt;/TD&gt;&lt;TD valign="top"&gt;ausername&lt;/TD&gt;&lt;TD valign="top"&gt;related&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;&lt;TD valign="top"&gt;2012-11-11 00:10:10&lt;/TD&gt;&lt;TD valign="top"&gt;0201&lt;/TD&gt;&lt;TD valign="top"&gt;320&lt;BR /&gt;312&lt;/TD&gt;&lt;TD valign="top"&gt;ausername&lt;/TD&gt;&lt;TD valign="top"&gt;primary&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;&lt;TD valign="top"&gt;2012-11-05 02:11:05&lt;/TD&gt;&lt;TD valign="top"&gt;320&lt;/TD&gt;&lt;TD valign="top"&gt;012&lt;/TD&gt;&lt;TD valign="top"&gt;ausername&lt;/TD&gt;&lt;TD valign="top"&gt;related&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;&lt;TD valign="top"&gt;2012-11-02 09:01:02&lt;/TD&gt;&lt;TD valign="top"&gt;312&lt;/TD&gt;&lt;TD valign="top"&gt;&lt;/TD&gt;&lt;TD valign="top"&gt;myuname&lt;/TD&gt;&lt;TD valign="top"&gt;related&lt;/TD&gt;&lt;/TR&gt;
&lt;/TBODY&gt;&lt;/TABLE&gt;

&lt;P&gt;It would be nice to dive even deeper and retrieve one more level of 'related events' by looking at the 'related_events' field of the related events as well. For example, the events: 012 &amp;amp; 666&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:40:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Help-with-Sideview-Utils-Dashboard-ValueSetter-ArrayValueSetter/m-p/50824#M2810</guid>
      <dc:creator>jpass</dc:creator>
      <dc:date>2020-09-28T14:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Sideview Utils Dashboard, ValueSetter, ArrayValueSetter and running 2nd search over a list of values?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Help-with-Sideview-Utils-Dashboard-ValueSetter-ArrayValueSetter/m-p/50825#M2811</link>
      <description>&lt;P&gt;FYI...it seems I was using the JOIN command wrong. It seems to be working fine but I'm still interested in an answer to this question.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2013 04:24:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Help-with-Sideview-Utils-Dashboard-ValueSetter-ArrayValueSetter/m-p/50825#M2811</guid>
      <dc:creator>jpass</dc:creator>
      <dc:date>2013-08-29T04:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Sideview Utils Dashboard, ValueSetter, ArrayValueSetter and running 2nd search over a list of values?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Help-with-Sideview-Utils-Dashboard-ValueSetter-ArrayValueSetter/m-p/50826#M2812</link>
      <description>&lt;P&gt;update: the join is still pretty slow so I like the method I described in my question.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2013 04:34:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Help-with-Sideview-Utils-Dashboard-ValueSetter-ArrayValueSetter/m-p/50826#M2812</guid>
      <dc:creator>jpass</dc:creator>
      <dc:date>2013-08-29T04:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Sideview Utils Dashboard, ValueSetter, ArrayValueSetter and running 2nd search over a list of values?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Help-with-Sideview-Utils-Dashboard-ValueSetter-ArrayValueSetter/m-p/50827#M2813</link>
      <description>&lt;P&gt;Could you post an extract of your "source" Data, and en example of what you want as result ?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2013 07:17:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Help-with-Sideview-Utils-Dashboard-ValueSetter-ArrayValueSetter/m-p/50827#M2813</guid>
      <dc:creator>sbsbb</dc:creator>
      <dc:date>2013-08-29T07:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Sideview Utils Dashboard, ValueSetter, ArrayValueSetter and running 2nd search over a list of values?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Help-with-Sideview-Utils-Dashboard-ValueSetter-ArrayValueSetter/m-p/50828#M2814</link>
      <description>&lt;P&gt;It was kind of dumb to ask two questions I guess. I've found the solution to my first problem:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Problem 1 - How could I create a field in search two that tells me if the result is 'primary' or 'related' ?&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Solution: In search one, include the list of primary refids as a field. Then use the resultsetter to push the value of the field down to the second search. In the second search, use eval &amp;amp; match() to set a value for "search_type"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;mysearch&amp;gt;| eval primary="$primary$" | search_type=if(match(primary,refid,"primary","related")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now I can use this field along with the TABLE MODULE to colorize the row so all related events are easily differentiated from the primary search results. &lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2013 16:06:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Help-with-Sideview-Utils-Dashboard-ValueSetter-ArrayValueSetter/m-p/50828#M2814</guid>
      <dc:creator>jpass</dc:creator>
      <dc:date>2013-08-29T16:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Sideview Utils Dashboard, ValueSetter, ArrayValueSetter and running 2nd search over a list of values?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Help-with-Sideview-Utils-Dashboard-ValueSetter-ArrayValueSetter/m-p/50829#M2815</link>
      <description>&lt;P&gt;I think there's a good pure search language solution to this problem.  I've mocked up your two sample events in a lookup so I could test it with inputlookup, and this search seems to produce the desired table:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;* | eval related_events=split(related_events," ") | eval unified_id=mvappend(related_events,refid) | mvexpand unified_id | eval is_related=if(isnotnull(mvfind(related_events,unified_id)),1,0) | stats values(related_events) as related_events max(is_related) as is_related by uname unified_id | eval type=if(is_related="1","related","primary") | fields - is_related | eval related_events=if(type=="primary",related_events,null())&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;and with no join or any other square-bracket syntax or subsearches, and with nothing terribly smart at the UI level besides a table to render it. &lt;/P&gt;

&lt;P&gt;Here is the output: &lt;/P&gt;

&lt;TABLE border="1"&gt;
&lt;TBODY&gt;&lt;TR&gt;&lt;TH&gt;uname&lt;/TH&gt;
&lt;TH&gt;unified_id &lt;/TH&gt;
&lt;TH&gt;related_events&lt;/TH&gt;
&lt;TH&gt;type&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="vertical-align:top;"&gt;barname&lt;/TD&gt;
&lt;TD style="vertical-align:top;"&gt;0201&lt;/TD&gt;
&lt;TD style="vertical-align:top;"&gt;312&lt;BR /&gt;320&lt;/TD&gt;
&lt;TD style="vertical-align:top;"&gt;primary&lt;/TD&gt;
&lt;/TR&gt;&lt;TR&gt;
&lt;TD style="vertical-align:top;"&gt;barname&lt;/TD&gt;
&lt;TD style="vertical-align:top;"&gt;312&lt;/TD&gt;
&lt;TD style="vertical-align:top;"&gt;&lt;/TD&gt;
&lt;TD style="vertical-align:top;"&gt;related&lt;/TD&gt;
&lt;/TR&gt;&lt;TR&gt;
&lt;TD style="vertical-align:top;"&gt;barname&lt;/TD&gt;
&lt;TD style="vertical-align:top;"&gt;320&lt;/TD&gt;
&lt;TD style="vertical-align:top;"&gt;&lt;/TD&gt;
&lt;TD style="vertical-align:top;"&gt;related&lt;/TD&gt;
&lt;/TR&gt;&lt;TR&gt;
&lt;TD style="vertical-align:top;"&gt;fooname&lt;/TD&gt;
&lt;TD style="vertical-align:top;"&gt;323&lt;/TD&gt;
&lt;TD style="vertical-align:top;"&gt;&lt;/TD&gt;
&lt;TD style="vertical-align:top;"&gt;related&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="vertical-align:top;"&gt;fooname&lt;/TD&gt;
&lt;TD style="vertical-align:top;"&gt;456&lt;/TD&gt;
&lt;TD style="vertical-align:top;"&gt;&lt;/TD&gt;
&lt;TD style="vertical-align:top;"&gt;related&lt;/TD&gt;
&lt;/TR&gt;&lt;TR&gt;
&lt;TD style="vertical-align:top;"&gt;fooname&lt;/TD&gt;
&lt;TD style="vertical-align:top;"&gt;789&lt;/TD&gt;
&lt;TD style="vertical-align:top;"&gt;&lt;/TD&gt;
&lt;TD style="vertical-align:top;"&gt;related&lt;/TD&gt;
&lt;/TR&gt;&lt;TR&gt;
&lt;TD style="vertical-align:top;"&gt;fooname&lt;/TD&gt;
&lt;TD style="vertical-align:top;"&gt;1234&lt;/TD&gt;
&lt;TD style="vertical-align:top;"&gt;323&lt;BR /&gt;456&lt;BR /&gt;789&lt;/TD&gt;
&lt;TD style="vertical-align:top;"&gt;primary&lt;/TD&gt;
&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;

&lt;P&gt;UPDATE: I added the table showing what the results look like above,  and also if you want a ime column,  you would just put something like &lt;CODE&gt;min(_time) as _time&lt;/CODE&gt; into the stats clause.&lt;/P&gt;

&lt;P&gt;Also I added a final eval to trim off the vestigial related_events field when the row isn't a "primary" row. &lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2013 17:31:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Help-with-Sideview-Utils-Dashboard-ValueSetter-ArrayValueSetter/m-p/50829#M2815</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2013-08-29T17:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Sideview Utils Dashboard, ValueSetter, ArrayValueSetter and running 2nd search over a list of values?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Help-with-Sideview-Utils-Dashboard-ValueSetter-ArrayValueSetter/m-p/50830#M2816</link>
      <description>&lt;P&gt;Very nice. Thanks for this I really appreciated it.&lt;/P&gt;</description>
      <pubDate>Sat, 31 Aug 2013 13:51:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Help-with-Sideview-Utils-Dashboard-ValueSetter-ArrayValueSetter/m-p/50830#M2816</guid>
      <dc:creator>jpass</dc:creator>
      <dc:date>2013-08-31T13:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Sideview Utils Dashboard, ValueSetter, ArrayValueSetter and running 2nd search over a list of values?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Help-with-Sideview-Utils-Dashboard-ValueSetter-ArrayValueSetter/m-p/50831#M2817</link>
      <description>&lt;P&gt;No problem. While it's nice to see you pushing the envelope on advanced Sideview Utils foo, in this case it's a job best done by the search language.&lt;/P&gt;</description>
      <pubDate>Sat, 31 Aug 2013 18:21:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Help-with-Sideview-Utils-Dashboard-ValueSetter-ArrayValueSetter/m-p/50831#M2817</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2013-08-31T18:21:53Z</dc:date>
    </item>
  </channel>
</rss>

