<?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 Can I combine two searches and group by _time using a regex filter? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-I-combine-two-searches-and-group-by-time-using-a-regex/m-p/293651#M88646</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm relatively new to Splunk, so please bear with me. What I am trying to accomplish is a time chart using tstats, but filtering the results using a regex. Specifically, this is for counting the number of times someone connects over HTTP/S to a naked IP (IP specified instead of a URL). The following two queries work, but when I try to combine them I get zero results:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count(Web.dest) AS destCount FROM datamodel=Web WHERE Web.action=blocked GROUPBY Web.dest | regex Web.dest="\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$"  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As you can see in the below screenshot, when grouped by Web.dest  I get a table with counts and the regex filter works fine.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3399iC2D6712E8A7ADDEA/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count(Web.dest) AS destCount FROM datamodel=Web WHERE Web.action=blocked GROUPBY _time span=1m
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As you can see in the below screenshot, when grouped by _time without the regex, I get a nice table which I can then use to create a time chart.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3400iA62CF8FCD8BB897C/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;However, if I try to combine the two queries and group by _time using a regex filter, I get zero results (screenshot not needed I think). &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count(Web.dest) AS destCount FROM datamodel=Web WHERE Web.action=blocked GROUPBY _time span=1m | regex Web.dest="\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$"  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can anyone assist me and/or confirm if what I'm trying to do is even possible? Your assistance is greatly appreciated.&lt;/P&gt;</description>
    <pubDate>Thu, 17 Aug 2017 19:08:09 GMT</pubDate>
    <dc:creator>sdtruesdale</dc:creator>
    <dc:date>2017-08-17T19:08:09Z</dc:date>
    <item>
      <title>Can I combine two searches and group by _time using a regex filter?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-combine-two-searches-and-group-by-time-using-a-regex/m-p/293651#M88646</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm relatively new to Splunk, so please bear with me. What I am trying to accomplish is a time chart using tstats, but filtering the results using a regex. Specifically, this is for counting the number of times someone connects over HTTP/S to a naked IP (IP specified instead of a URL). The following two queries work, but when I try to combine them I get zero results:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count(Web.dest) AS destCount FROM datamodel=Web WHERE Web.action=blocked GROUPBY Web.dest | regex Web.dest="\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$"  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As you can see in the below screenshot, when grouped by Web.dest  I get a table with counts and the regex filter works fine.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3399iC2D6712E8A7ADDEA/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count(Web.dest) AS destCount FROM datamodel=Web WHERE Web.action=blocked GROUPBY _time span=1m
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As you can see in the below screenshot, when grouped by _time without the regex, I get a nice table which I can then use to create a time chart.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3400iA62CF8FCD8BB897C/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;However, if I try to combine the two queries and group by _time using a regex filter, I get zero results (screenshot not needed I think). &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count(Web.dest) AS destCount FROM datamodel=Web WHERE Web.action=blocked GROUPBY _time span=1m | regex Web.dest="\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$"  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can anyone assist me and/or confirm if what I'm trying to do is even possible? Your assistance is greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 19:08:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-combine-two-searches-and-group-by-time-using-a-regex/m-p/293651#M88646</guid>
      <dc:creator>sdtruesdale</dc:creator>
      <dc:date>2017-08-17T19:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: Can I combine two searches and group by _time using a regex filter?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-combine-two-searches-and-group-by-time-using-a-regex/m-p/293652#M88647</link>
      <description>&lt;P&gt;The query your tried is just grouping by _time to no Web.dest field is available to filter. Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|  tstats count(Web.dest) AS destCount FROM datamodel=Web WHERE Web.action=blocked GROUPBY Web.dest _time span=1m | regex Web.dest="\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$"  
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Aug 2017 20:01:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-combine-two-searches-and-group-by-time-using-a-regex/m-p/293652#M88647</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-17T20:01:07Z</dc:date>
    </item>
  </channel>
</rss>

