Git Product home page Git Product logo

xesmarttarget's Introduction

XESmartTarget

XESmartTarget is the simplest way to write Extended Events data to a database table. But wait: there's more! XESmartTarget is the easiest way to process events without writing a single line of code!

XESmartTarget is a command line tool to help you working with SQL Server Extended Events. It offers the ability to perform custom actions in response to Events, in a way that is not possible by using the built-in targets.

While you are free to extend XESmartTarget with your own Response types, XESmartTarget does not require any coding. Instead, it can be configured with simple .json configuration files.

For instance, the following configuration file instructs XESmartTarget to connect to the server (local), hook to the Extended Events session test_session and forward all the events of type sql_batch_completed to a Response of type TableAppenderResponse, which will insert all events every 10 seconds into a table named test_session_data in the server (local), Database XESmartTargetTest, only the columns specified, only the rows with duration > 10000 microseconds.
It will also replay the sql_batch_completed events to the instance (local)\SQL2014 using the ReplayResponse Response type.

{
    "Target": {
        "ServerName": "(local)",
        "SessionName": "test_session",
        "Responses": [
            {
                //  JSON config files can contain comments
                "__type": "TableAppenderResponse",
                "ServerName": "(local)",
                "DatabaseName": "XESmartTargetTest",
                "TableName": "test_session_data",
                "AutoCreateTargetTable": true,
                "UploadIntervalSeconds": 10,
                "Events": [
                    "sql_batch_completed"
                ],
                "OutputColumns": [
                    "cpu_time", 
                    "duration", 
                    "physical_reads", 
                    "logical_reads", 
                    "writes", 
                    "row_count", 
                    "batch_text"
                ],
                "Filter": "duration > 10000"
            },
            {
                "__type": "ReplayResponse",
                "ServerName": "(local)\\SQL2014",
                "DatabaseName": "XESmartTargetTest",
                "Events": [
                    "sql_batch_completed"
                ],
                "StopOnError" : false
            }
        ]
    }
}

A complete description of all the setting you can control in the .JSON input file can be found in the Documentation.

Here is the output it produces: Screenshot 1

And here is the output it produces in the database: Screenshot 2

For the moment, the following Response types are available:

  • CsvAppenderResponse
  • EmailResponse
  • ExecuteTSQLResponse
  • ReplayResponse
  • TableAppenderResponse

New Response types are in the works, such as GroupedTableAppenderResponse (groups data before writing to a table). Suggestions for new Response Types are more than welcome.

Check out the Documentation for more information.

XelToCsv

XESmartTarget also includes a command line tool to convert .XEL files to .CSV.

Usage is very simple. Here's an example:

XelToCsv.exe -s c:\temp\events.xel -d c:\temp\events.csv

It's a Library!

XESmartTarget is a .dll that you can use in your project. Not sure how to use it? No problem, look at Program.cs in the XESmartTarget project. It's super easy.

xesmarttarget's People

Contributors

spaghettidba avatar awickham10 avatar mpiekarek avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.