Home
%3CLINGO-SUB%20id%3D%22lingo-sub-329808%22%20slang%3D%22en-US%22%3EHow%20to%20extend%20%22.show%20queries%22%20history%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-329808%22%20slang%3D%22en-US%22%3E%3CP%3EThe%20data%20is%20kept%20by%20for%20the%20last%2030%20days.%3C%2FP%3E%0A%3CP%3Eif%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%20style%3D%22font-weight%3A%20400%3B%22%3Eyou%20require%20accessing%20earlier%20information%20about%20queries%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3Eand%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%20style%3D%22font-weight%3A%20400%3B%22%3Ethat%20does%20not%20conflict%20with%20any%20security%2Fcompliance%20considerations%20users%20of%20your%20cluster%20may%20have%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3Ethen%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%20style%3D%22font-weight%3A%20400%3B%22%3Eyou%20can%20periodically%20export%20the%20data%20(using%20%E2%80%9C.show%20queries%E2%80%9D)%20and%20store%20it%20elsewhere%20(e.g.%20in%20a%20Kusto%20table%20in%20your%20database%2C%20using%20%E2%80%9C.set-or-append%E2%80%9D%20commands)%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CPRE%3Eset-or-append%20async%20history%20with(tags%3D'%5B%22ingest-by%3AmyTag%22%5D'%2C%20ingestIfNotExists%3D'%5B%22myTag%22%5D')%20%26lt%3B%7C%20%0A%20%20%20.show%20queries%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2012.0pt%3B%20font-family%3A%20inherit%3B%20color%3A%20%23333333%3B%20background%3A%20white%3B%22%3Easync%20command%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20-webkit-text-stroke-width%3A%200px%3B%20word-spacing%3A%200px%3B%22%3Ewill%20return%20immediately%20with%20an%20operation%20ID%20-%20a%20guid%20-%20which%20you%20can%20use%20for%20periodically%20polling%20for%20the%20operation's%20status%20(using%20%22.show%20operations%20%3CGUID%3E%22).%3C%2FGUID%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E.show%20operations%2071af658a-c2e7-4e0a-97bc-79643b12478a%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20258px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F71779i25A3992EBE068045%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Capture.PNG%22%20title%3D%22Capture.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-329808%22%20slang%3D%22en-US%22%3E%3CP%3EIt%20seems%20that%20I%20am%20only%20able%20to%20.show%20queries%20through%20about%20a%20month%20ago.%20Is%20there%20any%20way%20to%20show%20queries%20going%20back%20further%3F%3C%2FP%3E%0A%3CPRE%3E.show%20queries%20%3C%2FPRE%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-329808%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EHow%20to%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E

The data is kept by for the last 30 days.

if:

  • you require accessing earlier information about queries

and

  • that does not conflict with any security/compliance considerations users of your cluster may have

then:

  • you can periodically export the data (using “.show queries”) and store it elsewhere (e.g. in a Kusto table in your database, using “.set-or-append” commands)
set-or-append async history with(tags='["ingest-by:myTag"]', ingestIfNotExists='["myTag"]') <| 
   .show queries

async command will return immediately with an operation ID - a guid - which you can use for periodically polling for the operation's status (using ".show operations <guid>").

 

.show operations 71af658a-c2e7-4e0a-97bc-79643b12478a

Capture.PNG