Reads files that are created by the Extended Events asynchronous file target. One event, in XML format, is returned per row.
The event module GUID. Is not nullable.
The event package GUID. Is not nullable.
The name of the event. Is not nullable.
The event contents, in XML format. Is not nullable.
The name of the file that contains the event. Is not nullable.
The offset of the block in the file that contains the event. Is not nullable.
A. Retrieving data from file targets
The following example gets all the rows from all the files. In this example the file targets and metafiles are located in the trace folder on the C:\ drive.
select * from sys.fn_xe_file_target_read_file('C:\traces\*.xel', 'C:\traces\metafile.xem', null, null)