bin/XEtemplates/Queries and Resources.xml

<event_sessions xmlns="http://schemas.microsoft.com/sqlserver/2008/07/extendedeventconfig">
   <event_session name="Queries and Resources" maxMemory="4" eventRetentionMode="allowSingleEventLoss" trackCausality="true" dispatchLatency="30" maxEventSize="0" memoryPartitionMode="none">
    <templateCategory>
      <!-- _locID_text="templateCategory" _locComment = "" -->Everyday Extended Events</templateCategory>
    <templateName>
      <!-- _locID_text = "templateName" _locComment = "" -->Queries and Resources</templateName>
    <templateDescription>
      <!-- _locID_text = "templateDescription" _locComment = "" -->Captures query activity.</templateDescription>
      <event package="sqlserver" name="rpc_completed">
         <action package="sqlserver" name="client_app_name" />
         <action package="sqlserver" name="database_id" />
         <action package="sqlserver" name="query_hash" />
         <action package="sqlserver" name="session_id" />
         <parameter name="collect_statement" value="1" />
         <predicate>
            <and>
               <leaf>
                  <comparator name="greater_than_uint64" package="package0" />
                  <global name="database_id" package="sqlserver" />
                  <value>4</value>
               </leaf>
               <leaf>
                  <comparator name="equal_boolean" package="package0" />
                  <global name="is_system" package="sqlserver" />
                  <value>false</value>
               </leaf>
            </and>
         </predicate>
      </event>
      <event package="sqlserver" name="sp_statement_completed">
         <action package="sqlserver" name="client_app_name" />
         <action package="sqlserver" name="database_id" />
         <action package="sqlserver" name="query_hash" />
         <action package="sqlserver" name="query_plan_hash" />
         <action package="sqlserver" name="session_id" />
         <parameter name="collect_object_name" value="1" />
         <predicate>
            <and>
               <leaf>
                  <comparator name="greater_than_uint64" package="package0" />
                  <global name="database_id" package="sqlserver" />
                  <value>4</value>
               </leaf>
               <leaf>
                  <comparator name="equal_boolean" package="package0" />
                  <global name="is_system" package="sqlserver" />
                  <value>false</value>
               </leaf>
            </and>
         </predicate>
      </event>
      <event package="sqlserver" name="sql_batch_completed">
         <action package="sqlserver" name="client_app_name" />
         <action package="sqlserver" name="database_id" />
         <action package="sqlserver" name="query_hash" />
         <action package="sqlserver" name="session_id" />
         <predicate>
            <and>
               <leaf>
                  <comparator name="greater_than_uint64" package="package0" />
                  <global name="database_id" package="sqlserver" />
                  <value>4</value>
               </leaf>
               <leaf>
                  <comparator name="equal_boolean" package="package0" />
                  <global name="is_system" package="sqlserver" />
                  <value>false</value>
               </leaf>
            </and>
         </predicate>
      </event>
      <event package="sqlserver" name="sql_statement_completed">
         <action package="sqlserver" name="client_app_name" />
         <action package="sqlserver" name="database_id" />
         <action package="sqlserver" name="query_hash" />
         <action package="sqlserver" name="query_plan_hash" />
         <action package="sqlserver" name="session_id" />
         <predicate>
            <and>
               <leaf>
                  <comparator name="greater_than_uint64" package="package0" />
                  <global name="database_id" package="sqlserver" />
                  <value>4</value>
               </leaf>
               <leaf>
                  <comparator name="equal_boolean" package="package0" />
                  <global name="is_system" package="sqlserver" />
                  <value>false</value>
               </leaf>
            </and>
         </predicate>
      </event>
      <target package="package0" name="event_file">
         <parameter name="filename" value="capture_queries_and_resources.xel" />
         <parameter name="max_rollover_files" value="0" />
      </target>
      <target package="package0" name="ring_buffer">
         <parameter name="max_memory" value="1048576" />
      </target>
   </event_session>
</event_sessions>