Filtering Extended Events by Start Time

  • Hi, I'm setting up an Extended Event session to capture activity that's occurring overnight but I can't find a way to filter for RPCs that are execute between X and Y times.

    The closest I've found is to use a Job to start the session, this seems a bit antiquated.

    Can anyone point me in the right direction or enlighten me with their experience please?

    Thanks in advance.

     

  • Oooh, great question.

    I assumed that the best way to do this would be to schedule the start and stop of the session. However, upon investigation, yeah, that is the best answer. Despite the fact that when events fire, there is a confirmed date and time, it's not available as filtering criteria. It's not a fundamental part of the package for the event, and there are no actions for the time of an event. So, yeah, no way to do the filtering internally, so you'd have to start and stop the session for when you want to capture stuff.

    Thanks, short, if informative, blog post coming out of this one.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Hang on. Might have something else. Give me a sec to do an experiment.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Never mind. AI lied to me. I'm going with my original answer until I find something otherwise.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Grant Fritchey wrote:

    Never mind. AI lied to me.

    {sarcasm on}

    WHAT??? AI LIED??? Surely, you jest!  It's going to take over all our jobs, right?  RIGHT? 😉

    {sarcasm off (for the moment)}

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden wrote:

    Grant Fritchey wrote:

    Never mind. AI lied to me.

    {sarcasm on}

    WHAT??? AI LIED??? Surely, you jest!  It's going to take over all our jobs, right?  RIGHT? 😉

    {sarcasm off (for the moment)}

    I'm not sweating Skynet too much just yet.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Thanks for taking the time to investigate beyond your initial instinct.  I'm looking forward to reading about it in your blog .

    PS: Love the {sarcasm} switch

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply