<?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: Dashboard creation based on iterating through IP addresses in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-creation-based-on-iterating-through-IP-addresses/m-p/421320#M45371</link>
    <description>&lt;P&gt;Thanks for your input. Very helpful.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Aug 2019 20:10:31 GMT</pubDate>
    <dc:creator>elijahm</dc:creator>
    <dc:date>2019-08-05T20:10:31Z</dc:date>
    <item>
      <title>Dashboard creation based on iterating through IP addresses</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-creation-based-on-iterating-through-IP-addresses/m-p/421315#M45366</link>
      <description>&lt;P&gt;I want to create a search that will post the amount of users that haven't finished their registration transaction. There are three events that must be shown in the log for it to be a completed transaction: "IPInterceptor", "GetPolicy", and "ActivatedNode". I'm thinking of using their IP addresses to differentiate the users and I've done this using regex and creating a field for it called ip which holds all the IP addresses of the users using my application. Here's what I have in the search so far...&lt;/P&gt;

&lt;P&gt;blah...| rex "(?\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})"&lt;/P&gt;

&lt;P&gt;How do I iterate through the created ip field to confirm that a user has all three functions executed with their specific IP address and add up the total amount of users that did started with IPInterceptor but did not get to ActivateNode.&lt;/P&gt;

&lt;P&gt;Raw data example:&lt;/P&gt;

&lt;P&gt;...&lt;BR /&gt;
[Mon Jul 29 12:23:14][INFO ][11.12.21.318][]IPInterceptor.preHandle()&lt;BR /&gt;
...&lt;BR /&gt;
[Mon Jul 29 12:30:01][INFO ][11.12.21.318][]GetPolicy.doPost()&lt;BR /&gt;
...&lt;BR /&gt;
[Mon Jul 29 12:31:21][INFO ][11.12.21.318][]ActivateNode.doPost()&lt;BR /&gt;
...&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2019 17:54:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-creation-based-on-iterating-through-IP-addresses/m-p/421315#M45366</guid>
      <dc:creator>elijahm</dc:creator>
      <dc:date>2019-08-01T17:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard creation based on iterating through IP addresses</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-creation-based-on-iterating-through-IP-addresses/m-p/421316#M45367</link>
      <description>&lt;P&gt;First I made some fake data with a few more events than your sample:  &lt;CODE&gt;|makeresults . . . |mvexpand data&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval data="[Mon Jul 29 12:23:14][INFO ][11.12.21.318][]IPInterceptor.preHandle()...[Mon Jul 29 12:30:01][INFO ][11.12.21.318][]GetPolicy.doPost()...[Mon Jul 29 12:31:21][INFO ][11.12.21.318][]ActivateNode.doPost()...[Mon Jul 29 12:30:01][INFO ][11.12.47.318][]GetPolicy.doPost()...[Mon Jul 29 12:31:21][INFO ][11.47.21.318][]IPInterceptor.preHandle()"
| makemv delim="..." data
| mvexpand data
| rex field=data ".*\[(?&amp;lt;IP&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\]\[\](?&amp;lt;activity&amp;gt;IPInterceptor|GetPolicy|ActivateNode).*"
| stats list(activity) as activities by IP
| where match(activities, "IPInterceptor") 
| where NOT match(activities, "ActivateNode")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then create a field for IP and a field for activity, where activity has to be one of the three items you specified: &lt;CODE&gt;| rex field=data . . .&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;Then the last step is to list out which activities each IP address has passed through: &lt;CODE&gt;| stats list(activity) as activities by IP&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;And finally find the ones that you are interested in: &lt;CODE&gt;| where match(activities, "IPInterceptor") | where NOT match(activities, "ActivateNode")&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Good luck, I hope this helps!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2019 19:49:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-creation-based-on-iterating-through-IP-addresses/m-p/421316#M45367</guid>
      <dc:creator>grittonc</dc:creator>
      <dc:date>2019-08-01T19:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard creation based on iterating through IP addresses</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-creation-based-on-iterating-through-IP-addresses/m-p/421317#M45368</link>
      <description>&lt;P&gt;@elijahm Please check out the following run anywhere example. You need to play with the final filter to ensure that only events matching your requirement are pulled.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| search (NOT (uniqueTypes="ActivateNode.doPost" AND uniqueTypes="GetPolicy.doPost" AND uniqueTypes="IPInterceptor.preHandle")) AND (lastEvent!="ActivateNode.doPost" AND firstEvent="GetPolicy.doPost")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As per your question the filter in the examples:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;looks for Events which do not have all three types i.e. &lt;CODE&gt;ActivateNode.doPost, GetPolicy.doPost,IPInterceptor.preHandle&lt;/CODE&gt; &lt;/LI&gt;
&lt;LI&gt;looks for events which start with &lt;CODE&gt;GetPolicy.doPost&lt;/CODE&gt; but do not end with &lt;CODE&gt;ActivateNode.doPost&lt;/CODE&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Following is the anywhere example&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval data="[Mon Jul 29 12:23:14][INFO ][11.12.21.318][]IPInterceptor.preHandle()...[Mon Jul 29 12:30:01][INFO ][11.12.21.318][]GetPolicy.doPost()...[Mon Jul 29 12:31:21][INFO ][11.12.21.318][]ActivateNode.doPost()...[Mon Jul 29 12:23:14][INFO ][11.12.21.319][]IPInterceptor.preHandle()...[Mon Jul 29 12:30:01][INFO ][11.12.21.319][]GetPolicy.doPost()" 
| makemv data delim="..." 
| mvexpand data 
| rename data as _raw 
| rex "^\[(?&amp;lt;time&amp;gt;[^\]]+)\].*\[(?&amp;lt;ip&amp;gt;[^\]]+)\]\[\](?&amp;lt;type&amp;gt;[^\(]+)\(\)$" 
| eval _time=strptime(time,"%a %b %d %H:%M:%S") 
| fields - _raw time 
| sort - _time 
| stats count as eventCount min(_time) as _time max(_time) as latestTime list(type) as allTypes values(type) as uniqueTypes by ip 
| eval duration=latestTime-_time, firstEvent=mvindex(allTypes,0), lastEvent=mvindex(allTypes,eventCount-1) 
| fields - latestTime 
| search (NOT (uniqueTypes="ActivateNode.doPost" AND uniqueTypes="GetPolicy.doPost" AND uniqueTypes="IPInterceptor.preHandle")) AND (lastEvent!="ActivateNode.doPost" AND firstEvent="GetPolicy.doPost")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Aug 2019 20:05:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-creation-based-on-iterating-through-IP-addresses/m-p/421317#M45368</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2019-08-01T20:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard creation based on iterating through IP addresses</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-creation-based-on-iterating-through-IP-addresses/m-p/421318#M45369</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| rex "(?&amp;lt;src_ip&amp;gt;\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})\]\[\](?&amp;lt;function&amp;gt;[^\(]+)
| streamstats count(eval(searchmatch("IPInterceptor.preHandle"))) AS sessionID BY src_ip
| stats dc(function) AS function_count values(function) AS functions BY sessionID src_ip
| stats count AS total count(eval(function_count==3) AS complete
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Aug 2019 13:58:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-creation-based-on-iterating-through-IP-addresses/m-p/421318#M45369</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-08-02T13:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard creation based on iterating through IP addresses</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-creation-based-on-iterating-through-IP-addresses/m-p/421319#M45370</link>
      <description>&lt;P&gt;Thank you. This got me off to a great start.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 20:10:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-creation-based-on-iterating-through-IP-addresses/m-p/421319#M45370</guid>
      <dc:creator>elijahm</dc:creator>
      <dc:date>2019-08-05T20:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard creation based on iterating through IP addresses</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-creation-based-on-iterating-through-IP-addresses/m-p/421320#M45371</link>
      <description>&lt;P&gt;Thanks for your input. Very helpful.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 20:10:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-creation-based-on-iterating-through-IP-addresses/m-p/421320#M45371</guid>
      <dc:creator>elijahm</dc:creator>
      <dc:date>2019-08-05T20:10:31Z</dc:date>
    </item>
  </channel>
</rss>

