<?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: How to select particular path using `where` ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-select-particular-path-using-where/m-p/478655#M192883</link>
    <description>&lt;P&gt;@JyotiP &lt;BR /&gt;
Please check my UPDATED answer.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Nov 2019 05:30:05 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2019-11-06T05:30:05Z</dc:date>
    <item>
      <title>How to select particular path using `where` ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-select-particular-path-using-where/m-p/478652#M192880</link>
      <description>&lt;P&gt;I have the followinf query &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; sourcetype="server" host=*localqa*
    | stats count by Path 
    | rex field=Path "\/api\/(?&amp;lt;Path&amp;gt;.*)\/(v1|v2|v3)\/(?&amp;lt;Module&amp;gt;.*)" 
    | streamstats window=2 first(Path) as f_path count as c 
    | eval Path=case(c=1,Path,Path!=f_path,Path,1=1,"") 
    | table Path Module count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The output of the above query is &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;+-------------------------------------------------------------------------------+
|Path                                   | Module                        |count  |
+-------------------------------------------------------------------------------+
|profile                                | profileTravellroute           |212    |
|statements/trialbalance                | trialbalance                  |14     |
|iteneries/breakout                     | execution                     |1041   |
|                                       | orderDetails                  |117    |
|reporting/trans                        | schemes                       |712    |
|                                       | fixedIncome                   |40     |
|reporting                              | FinalizedReports              |161    |
|                                       | PendingReports                |8      |
|                                       | reportEntries                 |14     |
|                                       | closedReport                  |22     |
|                                       | reportTimes                   |82     |
|                                       | Reportposition                |40     |
|                                       | ReportStates                  |68     |
+-------------------------------------------------------------------------------+
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to select records only for reporting &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;+-------------------------------------------------------------------------------+
|Path                                   | Module                        |count  |
+-------------------------------------------------------------------------------+
|reporting/trans                        | schemes                       |712    |
|                                       | fixedIncome                   |40     |
|reporting                              | FinalizedReports              |161    |
|                                       | PendingReports                |8      |
|                                       | reportEntries                 |14     |
|                                       | closedReport                  |22     |
|                                       | reportTimes                   |82     |
|                                       | Reportposition                |40     |
|                                       | ReportStates                  |68     |
+-------------------------------------------------------------------------------+
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Tried with &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="server" host=*localqa*
| stats count by Path 
| rex field=Path "\/api\/(?&amp;lt;Path&amp;gt;.*)\/(v1|v2|v3)\/(?&amp;lt;Module&amp;gt;.*)" 
| streamstats window=2 first(Path) as f_path count as c 
| eval Path=case(c=1,Path,Path!=f_path,Path,1=1,"") 
| where Like (Path, 'reporting%')
| table Path Module count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But not working only the following section are coming&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; +------------------------------------------------------------------------------------------------+
    |Path                                           |Module                                |Count       |
    +------------------------------------------------------------------------------------------------+
    |reporting/trans                        | schemes                            |712    |
                                                         | fixedIncome                      |40     |
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Nov 2019 12:38:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-select-particular-path-using-where/m-p/478652#M192880</guid>
      <dc:creator>JyotiP</dc:creator>
      <dc:date>2019-11-05T12:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to select particular path using `where` ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-select-particular-path-using-where/m-p/478653#M192881</link>
      <description>&lt;P&gt;@JyotiP &lt;/P&gt;

&lt;P&gt;Can you please try these ?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="server" host=*localqa* 
| stats count by Path 
| rex field=Path "\/api\/(?&amp;lt;Path&amp;gt;.*)\/(v1|v2|v3)\/(?&amp;lt;Module&amp;gt;.*)" 
| streamstats window=2 first(Path) as f_path count as c 
| eval Path=case(c=1,Path,Path!=f_path,Path,1=1,"") 
| table Path Module count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="server" host=*localqa* 
| stats count by Path 
| rex field=Path "\/api\/(?&amp;lt;Path&amp;gt;.*)\/(v1|v2|v3)\/(?&amp;lt;Module&amp;gt;.*)" 
| streamstats window=2 first(Path) as f_path count as c 
| eval Path=case(c=1,Path,Path!=f_path,Path,1=1,"") 
 | where like(Path,"%reporting%")
| table Path Module count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;UPDATED Answer:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="server" host=*localqa* 
| stats count by Path 
| rex field=Path "\/api\/(?&amp;lt;Path&amp;gt;.*)\/(v1|v2|v3)\/(?&amp;lt;Module&amp;gt;.*)" 
| streamstats window=2 first(Path) as f_path count as c 
| eval Path=case(c=1,Path,Path!=f_path,Path,1=1,"") 
| streamstats window=2 last(Path) as Lpath | eval Lpath=if(Lpath!="",Lpath,NULL) | filldown Lpath
| where like(Lpath,"%reporting%")
| table Path Module Count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Sample Search:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval Path="profile", Module="profileTravellroute", Count="212"  | append [
| makeresults | eval Path="statements/trialbalance", Module="trialbalance", Count="12" ] | append [
| makeresults | eval Path="iteneries/breakout", Module="execution", Count="121" ] | append [
| makeresults | eval Path="", Module="orderDetails", Count="129" ] | append [
| makeresults | eval Path="reporting/trans", Module="schemes", Count="127" ] | append [
| makeresults | eval Path="", Module="fixedIncome", Count="122" ] | append [
| makeresults | eval Path="reporting", Module="FinalizedReports", Count="125" ] | append [
| makeresults | eval Path="", Module="reportEntries", Count="122" ] | append [
| makeresults | eval Path="", Module="Reportposition", Count="123" ] | table Path Module Count 
| streamstats window=2 last(Path) as Lpath | eval Lpath=if(Lpath!="",Lpath,NULL) | filldown Lpath
| where like(Lpath,"%reporting%")
| table Path Module Count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 12:52:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-select-particular-path-using-where/m-p/478653#M192881</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-11-05T12:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to select particular path using `where` ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-select-particular-path-using-where/m-p/478654#M192882</link>
      <description>&lt;P&gt;@kamlesh_vaghela only one record from each path is retrieving in both the query, I want  all the records&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 13:22:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-select-particular-path-using-where/m-p/478654#M192882</guid>
      <dc:creator>JyotiP</dc:creator>
      <dc:date>2019-11-05T13:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to select particular path using `where` ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-select-particular-path-using-where/m-p/478655#M192883</link>
      <description>&lt;P&gt;@JyotiP &lt;BR /&gt;
Please check my UPDATED answer.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 05:30:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-select-particular-path-using-where/m-p/478655#M192883</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-11-06T05:30:05Z</dc:date>
    </item>
  </channel>
</rss>

