en-US/SqlServer.XEvent.dll-Help.xml

<?xml version="1.0" encoding="utf-8"?>
<helpItems schema="maml" xmlns="http://msh">
  <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
    <command:details>
      <command:name>Read-SqlXEvent</command:name>
      <command:verb>Read</command:verb>
      <command:noun>SqlXEvent</command:noun>
      <maml:description>
        <maml:para>Read SQL Server XEvents from XEL file or live SQL XEvent session.</maml:para>
      </maml:description>
    </command:details>
    <maml:description>
      <maml:para>The Read-SqlXEvent reads SQL Server XEvents from a file or live SQL XEvent session. XEvent sessions are created by the CREATE EVENT SESSION Transact-SQL API. SQL XEvent files usually have the .XEL or .sqlaudit extensions and contain a stream of XEvents. The structure of the XEvents is defined in the session configuration. SQL live streams are available via the SQL TDS protocol and require authetication against the server that produced them.</maml:para>
    </maml:description>
    <command:syntax>
      <command:syntaxItem>
        <maml:name>Read-SqlXEvent</maml:name>
        <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
          <maml:name>ConnectionString</maml:name>
          <maml:Description>
            <maml:para>SQL Server connection string.</maml:para>
          </maml:Description>
          <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
          <dev:type>
            <maml:name>String</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
        <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
          <maml:name>SessionName</maml:name>
          <maml:Description>
            <maml:para>The SQL Server XEvent session name as defined by the CREATE EVENT SESSION Transact-SQL.</maml:para>
          </maml:Description>
          <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
          <dev:type>
            <maml:name>String</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
      </command:syntaxItem>
      <command:syntaxItem>
        <maml:name>Read-SqlXEvent</maml:name>
        <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none">
          <maml:name>FileName</maml:name>
          <maml:Description>
            <maml:para>File name of a XEvent file to read.</maml:para>
          </maml:Description>
          <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
          <dev:type>
            <maml:name>String</maml:name>
            <maml:uri />
          </dev:type>
          <dev:defaultValue>None</dev:defaultValue>
        </command:parameter>
      </command:syntaxItem>
    </command:syntax>
    <command:parameters>
      <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
        <maml:name>ConnectionString</maml:name>
        <maml:Description>
          <maml:para>SQL Server connection string.</maml:para>
        </maml:Description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
        <dev:type>
          <maml:name>String</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
      <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none">
        <maml:name>FileName</maml:name>
        <maml:Description>
          <maml:para>File name of a XEvent file to read.</maml:para>
        </maml:Description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
        <dev:type>
          <maml:name>String</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
      <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
        <maml:name>SessionName</maml:name>
        <maml:Description>
          <maml:para>The SQL Server XEvent session name as defined by the CREATE EVENT SESSION Transact-SQL.</maml:para>
        </maml:Description>
        <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
        <dev:type>
          <maml:name>String</maml:name>
          <maml:uri />
        </dev:type>
        <dev:defaultValue>None</dev:defaultValue>
      </command:parameter>
    </command:parameters>
    <command:inputTypes>
      <command:inputType>
        <dev:type>
          <maml:name>System.String</maml:name>
        </dev:type>
        <maml:description>
          <maml:para></maml:para>
        </maml:description>
      </command:inputType>
    </command:inputTypes>
    <command:returnValues>
      <command:returnValue>
        <dev:type>
          <maml:name>Microsoft.SqlServer.XEvent.XELite.IXEvent</maml:name>
        </dev:type>
        <maml:description>
          <maml:para></maml:para>
        </maml:description>
      </command:returnValue>
    </command:returnValues>
    <maml:alertSet>
      <maml:alert>
        <maml:para></maml:para>
      </maml:alert>
    </maml:alertSet>
    <command:examples>
      <command:example>
        <maml:title>-------------------------- Example 1 --------------------------</maml:title>
        <dev:code>PS C:\&gt; Read-SqlXEvent -FileName C:\audits\Audit-20190529-132659.sqlaudit
 
Name : audit_event
UUID : c6479a6f-f1bd-4759-9881-fcb493821aff
Timestamp : 6/13/2019 7:49:42 AM +00:00
Fields : {[audit_schema_version, 1], [event_time, 6/13/2019 7:49:42 AM +00:00], [sequence_number, 1], [action_id,
            1129534785]�}
Actions : {}
 
Name : audit_event
UUID : c6479a6f-f1bd-4759-9881-fcb493821aff
Timestamp : 6/13/2019 12:42:28 PM +00:00
Fields : {[audit_schema_version, 1], [event_time, 6/13/2019 12:42:28 PM +00:00], [sequence_number, 1], [action_id,
            1129534785]�}
Actions : {}</dev:code>
        <dev:remarks>
          <maml:para>Read &amp; parse the sqlaudit file. Each object returned will contain all the information from a single audit record.</maml:para>
        </dev:remarks>
      </command:example>
      <command:example>
        <maml:title>-------------------------- Example 2 --------------------------</maml:title>
        <dev:code>PS C:\&gt; Read-SQLXEvent -ConnectionString "Server=.;Database=master;Trusted_Connection=True;" -SessionName perf_session
 
Name : sql_statement_completed
UUID : cdfd84f9-184e-49a4-bb71-1614a9d30416
Timestamp : 6/20/2019 6:49:50 AM +00:00
Fields : {[duration, 7], [cpu_time, 0], [physical_reads, 0], [logical_reads, 0]�}
Actions : {[sql_text, SELECT @@SPID; ]}
 
Name : sql_statement_completed
UUID : cdfd84f9-184e-49a4-bb71-1614a9d30416
Timestamp : 6/20/2019 6:49:50 AM +00:00
Fields : {[duration, 13], [cpu_time, 0], [physical_reads, 0], [logical_reads, 0]�}
Actions : {[sql_text, select 42
             ]}</dev:code>
        <dev:remarks>
          <maml:para>Read &amp; parse the live stream of XEvents from the SQL Server running on the same machine connected with Windows authentication. Each object returned will contain all the information from a single XEvent record.</maml:para>
        </dev:remarks>
      </command:example>
    </command:examples>
    <command:relatedLinks>
      <maml:navigationLink>
        <maml:linkText>https://docs.microsoft.com/azure/sql-database/sql-database-xevent-db-diff-from-svr</maml:linkText>
        <maml:uri>https://docs.microsoft.com/en-us/azure/sql-database/sql-database-xevent-db-diff-from-svr</maml:uri>
      </maml:navigationLink>
      <maml:navigationLink>
        <maml:linkText>https://docs.microsoft.com/sql/t-sql/statements/create-event-session-transact-sql</maml:linkText>
        <maml:uri>https://docs.microsoft.com/en-us/sql/t-sql/statements/create-event-session-transact-sql</maml:uri>
      </maml:navigationLink>
      <maml:navigationLink>
        <maml:linkText>https://docs.microsoft.com/sql/t-sql/statements/create-server-audit-transact-sql</maml:linkText>
        <maml:uri>https://docs.microsoft.com/en-us/sql/t-sql/statements/create-server-audit-transact-sql</maml:uri>
      </maml:navigationLink>
    </command:relatedLinks>
  </command:command>
</helpItems>