<?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 How to convert at InfluxDB SQL query to a Splunk SPL search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-at-InfluxDB-SQL-query-to-a-Splunk-SPL-search/m-p/291692#M88113</link>
    <description>&lt;P&gt;We have a FIG (fluentD/InfluxDB/Grafana) setup in which we want to change the IG part to Splunk.  We have several dashboards we need to convert. A picture of 1 of them is attached.  The SQL query we use is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SELECT mean(\"value\") FROM \"dev.agent\" WHERE (\"type\" = 'traffic-stats.rxpps' OR \"type\" = 'traffic-stats.txpps') AND \"device\" =~ /$host_regex/ AND \"interface\" =~ /$interface$/ AND $timeFilter GROUP BY \"device\", \"interface\", \"type\", time($GroupBy)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What would the SPL look like? I have fluentD pushing the data into its only index in Splunk.  The index is called "sandbox"&lt;/P&gt;

&lt;P&gt;I assume the SPL query would start with&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="sandbox" AND (type="traffic-stats.rxpps" OR type="traffic-stats.txpps") AND (device=
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That's as far as I have gotten. I need to dynamical select a device and interface. I have no clue how to code the "GROUP BY" SPL equivalent.&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&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/2924i52D0FA9EEFDD5B8E/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt; &lt;/P&gt;</description>
    <pubDate>Fri, 12 May 2017 21:36:20 GMT</pubDate>
    <dc:creator>registration9</dc:creator>
    <dc:date>2017-05-12T21:36:20Z</dc:date>
    <item>
      <title>How to convert at InfluxDB SQL query to a Splunk SPL search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-at-InfluxDB-SQL-query-to-a-Splunk-SPL-search/m-p/291692#M88113</link>
      <description>&lt;P&gt;We have a FIG (fluentD/InfluxDB/Grafana) setup in which we want to change the IG part to Splunk.  We have several dashboards we need to convert. A picture of 1 of them is attached.  The SQL query we use is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SELECT mean(\"value\") FROM \"dev.agent\" WHERE (\"type\" = 'traffic-stats.rxpps' OR \"type\" = 'traffic-stats.txpps') AND \"device\" =~ /$host_regex/ AND \"interface\" =~ /$interface$/ AND $timeFilter GROUP BY \"device\", \"interface\", \"type\", time($GroupBy)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What would the SPL look like? I have fluentD pushing the data into its only index in Splunk.  The index is called "sandbox"&lt;/P&gt;

&lt;P&gt;I assume the SPL query would start with&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="sandbox" AND (type="traffic-stats.rxpps" OR type="traffic-stats.txpps") AND (device=
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That's as far as I have gotten. I need to dynamical select a device and interface. I have no clue how to code the "GROUP BY" SPL equivalent.&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&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/2924i52D0FA9EEFDD5B8E/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2017 21:36:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-at-InfluxDB-SQL-query-to-a-Splunk-SPL-search/m-p/291692#M88113</guid>
      <dc:creator>registration9</dc:creator>
      <dc:date>2017-05-12T21:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert at InfluxDB SQL query to a Splunk SPL search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-at-InfluxDB-SQL-query-to-a-Splunk-SPL-search/m-p/291693#M88114</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="sandbox" earliest=timeFilterMinValue latest=timeFilterMaxValue AND (type="traffic-stats.rxpps" OR type="traffic-stats.txpps")
| where match(device, "HostRegExHere") AND match(interface, "InterfaceRegExHere")
| eval dev_int_type = device . "/" . interface . "/". type
| timechart span=5m mean(value) BY dev_int_type 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 May 2017 23:50:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-at-InfluxDB-SQL-query-to-a-Splunk-SPL-search/m-p/291693#M88114</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-12T23:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert at InfluxDB SQL query to a Splunk SPL search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-at-InfluxDB-SQL-query-to-a-Splunk-SPL-search/m-p/605927#M210708</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/39590"&gt;@registration9&lt;/a&gt;&amp;nbsp;did you connect splunkdb with influxdb?&lt;/P&gt;&lt;P&gt;i try it but got error:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Splunk-Search/driver-influxdb-to-splunk-db/m-p/605850#M210681" target="_blank"&gt;https://community.splunk.com/t5/Splunk-Search/driver-influxdb-to-splunk-db/m-p/605850#M210681&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;would please how do you do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 06:40:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-at-InfluxDB-SQL-query-to-a-Splunk-SPL-search/m-p/605927#M210708</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2022-07-18T06:40:06Z</dc:date>
    </item>
  </channel>
</rss>

