<?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: Trouble with MultiValue Fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Trouble-with-MultiValue-Fields/m-p/98754#M25449</link>
    <description>&lt;P&gt;This is a bit of a trick, but you could do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=smartypants_app action=remote_auth earliest=-2d@d latest=-1d@d 
| append [ search sourcetype=smartypants_app action=remote_auth install=true earliest=-3d@d latest=-2d@d  ]
| bucket _time span=1d 
| stats min(_time) as firstseen,max(_time) as lastseen by user 
| stats count(eval(firstseen&amp;lt;=relative_time(now(),"-3d@d")) as installedonday1
        count(eval(firstseen!=lastseen)) as installed_and_returned
  by user
| eval installed_and_returned/installedonday1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This particular example isn't too generalizable to (for example) getting day x+1 &lt;EM&gt;and&lt;/EM&gt; day x+2 users in the same query and differentiating, but it is possible to slightly rewrite it to be more tweakable (though longer).&lt;/P&gt;</description>
    <pubDate>Thu, 27 Oct 2011 06:30:58 GMT</pubDate>
    <dc:creator>gkanapathy</dc:creator>
    <dc:date>2011-10-27T06:30:58Z</dc:date>
    <item>
      <title>Trouble with MultiValue Fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trouble-with-MultiValue-Fields/m-p/98753#M25448</link>
      <description>&lt;P&gt;Hello community!&lt;/P&gt;

&lt;P&gt;We're really stuck on a question ... Basically we are trying to do ask the following question&lt;/P&gt;

&lt;P&gt;For users who installed on day X, what % came back on day X+1?&lt;/P&gt;

&lt;P&gt;1) We have installs logged sourcetype="smartypants_app"  action="remote_auth" install=true | timechart span=1day values(user) as user dc(user) as installs&lt;BR /&gt;
2) We have logins sourcetype="smartypants_app"  action="remote_auth"  | timechart span=1day values(user) as user dc(user) as logins&lt;/P&gt;

&lt;P&gt;If this was SQL we would do something like &lt;/P&gt;

&lt;P&gt;SELECT *  FROM remote_auth installs, remote_auth logins WHERE installs._time BETWEEN x AND x+1 AND logins._time BETWEEN x+1 AND x+2 AND installs.user = logins.user GROUP BY installs.user&lt;/P&gt;

&lt;P&gt;Problem: how to do this in Splunk?&lt;/P&gt;

&lt;P&gt;Many thanks for anyone willing to help!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 10:01:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trouble-with-MultiValue-Fields/m-p/98753#M25448</guid>
      <dc:creator>dealmak3r</dc:creator>
      <dc:date>2020-09-28T10:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with MultiValue Fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trouble-with-MultiValue-Fields/m-p/98754#M25449</link>
      <description>&lt;P&gt;This is a bit of a trick, but you could do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=smartypants_app action=remote_auth earliest=-2d@d latest=-1d@d 
| append [ search sourcetype=smartypants_app action=remote_auth install=true earliest=-3d@d latest=-2d@d  ]
| bucket _time span=1d 
| stats min(_time) as firstseen,max(_time) as lastseen by user 
| stats count(eval(firstseen&amp;lt;=relative_time(now(),"-3d@d")) as installedonday1
        count(eval(firstseen!=lastseen)) as installed_and_returned
  by user
| eval installed_and_returned/installedonday1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This particular example isn't too generalizable to (for example) getting day x+1 &lt;EM&gt;and&lt;/EM&gt; day x+2 users in the same query and differentiating, but it is possible to slightly rewrite it to be more tweakable (though longer).&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2011 06:30:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trouble-with-MultiValue-Fields/m-p/98754#M25449</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2011-10-27T06:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with MultiValue Fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trouble-with-MultiValue-Fields/m-p/98755#M25450</link>
      <description>&lt;P&gt;Hi gkanapathy,&lt;/P&gt;

&lt;P&gt;This answer is great! Except.... we actually want to repeat for N days. &lt;/P&gt;

&lt;P&gt;So using the sample group of users from 7 days ago, we want to know the % who came back on day 2-5....&lt;/P&gt;

&lt;P&gt;so i can't hard code -3d@d/-2d@d as in your proposal... can splunk do a range like this?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2011 04:54:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trouble-with-MultiValue-Fields/m-p/98755#M25450</guid>
      <dc:creator>dealmak3r</dc:creator>
      <dc:date>2011-10-28T04:54:16Z</dc:date>
    </item>
  </channel>
</rss>

