<?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: Request using datamodel in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/Request-using-datamodel/m-p/477405#M7678</link>
    <description>&lt;P&gt;Thanks a lot for your answer.&lt;BR /&gt;
back from holidays, i'm gonna try this...&lt;/P&gt;</description>
    <pubDate>Mon, 02 Mar 2020 08:40:08 GMT</pubDate>
    <dc:creator>gduc</dc:creator>
    <dc:date>2020-03-02T08:40:08Z</dc:date>
    <item>
      <title>Request using datamodel</title>
      <link>https://community.splunk.com/t5/Reporting/Request-using-datamodel/m-p/477403#M7676</link>
      <description>&lt;P&gt;Hello;&lt;/P&gt;

&lt;P&gt;I've got this request running on my searchhead server:&lt;BR /&gt;
Job report : "This search has completed and has returned 1 101 résults by scanning 29 230 690 events in 860,672 seconds"&lt;BR /&gt;
Execution time : 860,672 seconds aka 14 minutes and 20 seconds, running on "previous week"&lt;/P&gt;

&lt;P&gt;Here is the request:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=csmsi_supervision_active u_ci_name=PE* cmd=check_interface_traffic 
| fields u_ci_name, svc, ds, traffic_in_bps, traffic_out_bps, if_alias, _time
| dedup svc, ds
| eval Kbps_In=traffic_in_bps/1000, Kbps_Out=traffic_out_bps/1000, Periode=strftime(_time,"%Y-%V")
| rex field=if_alias "(?.*_vers_(?:(?:PE)|(?:P0)|(?:P1)|(?:CE)).*)"
| stats  avg(Kbps_In) as "In_Moy", exactperc90(Kbps_In) as "In_Perc90", max(Kbps_In) as "In_Max",  avg(Kbps_Out) as "Out_Moy", exactperc90(Kbps_Out) as "Out_Perc90", max(Kbps_Out) as "Out_Max" , values(Periode) as "Periode", latest(_time) as "_time"  by u_ci_name, rex_if_alias
| table Periode u_ci_name rex_if_alias In_Moy In_Perc90 In_Max Out_Moy Out_Perc90 Out_Max _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I read that using accelerated datamodels could reduce my request duration....&lt;BR /&gt;
So I started to build one...&lt;/P&gt;

&lt;P&gt;datamodel_name : CSMSI_ARGOSS_Active_Metrics (rebuilt)&lt;BR /&gt;
node_name : metrics&lt;BR /&gt;
node_childs : icmp and traffic are just each one hiding few fields depending witch one I need or not&lt;/P&gt;

&lt;P&gt;Here is my request using datamodel :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|tstats summariesonly=true 
 values(metrics.u_ci_name) as u_ci_name, 
 values(metrics.svc) as svc, 
 values(metrics.ds) as ds, 
 values(metrics.traffic_in_bps) as traffic_in_bps, 
 values(metrics.traffic_out_bps) as traffic_out_bps, 
 values(metrics.if_alias) as if_alias
 From datamodel=CSMSI_ARGOSS_Active_Metrics 
 Where nodename=metrics u_ci_name=PE*
| fields u_ci_name, svc, ds, traffic_in_bps, traffic_out_bps, if_alias, _time
| dedup svc, ds
| eval Kbps_In=traffic_in_bps/1000, Kbps_Out=traffic_out_bps/1000, Periode=strftime(_time,"%Y-%V")
| rex field=if_alias "(?.*_vers_(?:(?:PE)|(?:P0)|(?:P1)|(?:CE)).*)"
| stats  avg(Kbps_In) as "In_Moy", exactperc90(Kbps_In) as "In_Perc90", max(Kbps_In) as "In_Max",  avg(Kbps_Out) as "Out_Moy", exactperc90(Kbps_Out) as "Out_Perc90", max(Kbps_Out) as "Out_Max" , values(Periode) as "Periode", latest(_time) as "_time"  by u_ci_name, rex_if_alias
| table Periode u_ci_name rex_if_alias In_Moy In_Perc90 In_Max Out_Moy Out_Perc90 Out_Max _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but do not give result (0 results found) in "8 seconds executing time" according to search.log&lt;/P&gt;

&lt;P&gt;My question is, where is my issue?&lt;BR /&gt;
ps1: 1st time I write this kind of request&lt;BR /&gt;
ps2: I've got other request running on "previous month" and aborting after +2hours by timeout&lt;/P&gt;

&lt;P&gt;Thanks for helping &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;IMG src="https://community.splunk.com/storage/temp/282693-tstats-request.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:18:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Request-using-datamodel/m-p/477403#M7676</guid>
      <dc:creator>gduc</dc:creator>
      <dc:date>2020-09-30T04:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: Request using datamodel</title>
      <link>https://community.splunk.com/t5/Reporting/Request-using-datamodel/m-p/477404#M7677</link>
      <description>&lt;P&gt;When datamodels are used in &lt;CODE&gt;tstats&lt;/CODE&gt; the fields returned all begin with the name of the datamodel, however the &lt;CODE&gt;fields&lt;/CODE&gt; command is selecting fields that do not have a datamodel name.  You then end up with a bunch of null fields.&lt;/P&gt;

&lt;P&gt;Build your query one statement at a time and verify the results before adding the next statement.  Then you should be able to see where the results stray from those desired.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 19:10:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Request-using-datamodel/m-p/477404#M7677</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-02-21T19:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Request using datamodel</title>
      <link>https://community.splunk.com/t5/Reporting/Request-using-datamodel/m-p/477405#M7678</link>
      <description>&lt;P&gt;Thanks a lot for your answer.&lt;BR /&gt;
back from holidays, i'm gonna try this...&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 08:40:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Request-using-datamodel/m-p/477405#M7678</guid>
      <dc:creator>gduc</dc:creator>
      <dc:date>2020-03-02T08:40:08Z</dc:date>
    </item>
  </channel>
</rss>

