Aracılığıyla paylaş


Query - Get

Analiz sorgusu yürütme
Veriler için analiz sorgusu yürütür

GET https://api.applicationinsights.io/v1/apps/{appId}/query?query={query}
GET https://api.applicationinsights.io/v1/apps/{appId}/query?query={query}&timespan={timespan}

URI Parametreleri

Name İçinde Gerekli Tür Description
appId
path True

string

Uygulamanın kimliği. Bu, Azure portal API Erişim ayarları dikey penceresindeki Uygulama Kimliği'dir.

query
query True

string

Analiz sorgusu. Analiz sorgusu söz dizimi hakkında daha fazla bilgi edinin

timespan
query

string

İsteğe bağlı. Verilerin sorgulandığı zaman aralığı. Bu ISO8601 zaman aralığı değeridir. Bu zaman aralığı, sorgu ifadesinde belirtilenlere ek olarak uygulanır.

Yanıtlar

Name Tür Description
200 OK

queryResults

Başarılı yanıt

Other Status Codes

errorResponse

Hata yanıtı nesnesi.

Güvenlik

oauth2

Azure Uygulaması Insights API'sine bağlanma

Tür: oauth2
Akış: implicit
Yetkilendirme URL’si: https://login.microsoftonline.com/common/oauth2/authorize?resource=https%3A%2F%2Fapi.applicationinsights.io

Kapsamlar

Name Description
user_impersonation kullanıcı hesabınızın kimliğine bürünme

Örnekler

queryGet

Örnek isteği

GET https://api.applicationinsights.io/v1/apps/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/query?query=requests | take 10&timespan=PT12H

Örnek yanıt

x-ms-request-id: 58a37988-2c05-427a-891f-5e0e1266fcc5
x-ms-correlation-request-id: 58a37988-2c05-427a-891f-5e0e1266fcc5
{
  "tables": [
    {
      "name": "PrimaryResult",
      "columns": [
        {
          "name": "timestamp",
          "type": "datetime"
        },
        {
          "name": "id",
          "type": "string"
        },
        {
          "name": "source",
          "type": "string"
        },
        {
          "name": "name",
          "type": "string"
        },
        {
          "name": "url",
          "type": "string"
        },
        {
          "name": "success",
          "type": "string"
        },
        {
          "name": "resultCode",
          "type": "string"
        },
        {
          "name": "duration",
          "type": "real"
        },
        {
          "name": "performanceBucket",
          "type": "string"
        },
        {
          "name": "customDimensions",
          "type": "dynamic"
        },
        {
          "name": "customMeasurements",
          "type": "dynamic"
        },
        {
          "name": "operation_Name",
          "type": "string"
        },
        {
          "name": "operation_Id",
          "type": "string"
        },
        {
          "name": "operation_ParentId",
          "type": "string"
        },
        {
          "name": "operation_SyntheticSource",
          "type": "string"
        },
        {
          "name": "session_Id",
          "type": "string"
        },
        {
          "name": "user_Id",
          "type": "string"
        },
        {
          "name": "user_AuthenticatedId",
          "type": "string"
        },
        {
          "name": "user_AccountId",
          "type": "string"
        },
        {
          "name": "application_Version",
          "type": "string"
        },
        {
          "name": "client_Type",
          "type": "string"
        },
        {
          "name": "client_Model",
          "type": "string"
        },
        {
          "name": "client_OS",
          "type": "string"
        },
        {
          "name": "client_IP",
          "type": "string"
        },
        {
          "name": "client_City",
          "type": "string"
        },
        {
          "name": "client_StateOrProvince",
          "type": "string"
        },
        {
          "name": "client_CountryOrRegion",
          "type": "string"
        },
        {
          "name": "client_Browser",
          "type": "string"
        },
        {
          "name": "cloud_RoleName",
          "type": "string"
        },
        {
          "name": "cloud_RoleInstance",
          "type": "string"
        },
        {
          "name": "appId",
          "type": "string"
        },
        {
          "name": "appName",
          "type": "string"
        },
        {
          "name": "iKey",
          "type": "string"
        },
        {
          "name": "sdkVersion",
          "type": "string"
        },
        {
          "name": "itemId",
          "type": "string"
        },
        {
          "name": "itemType",
          "type": "string"
        },
        {
          "name": "itemCount",
          "type": "int"
        }
      ],
      "rows": [
        [
          "2018-02-01T17:33:09.788Z",
          "|0qRud6jz3k0=.c32c2659_",
          null,
          "GET Reports/Index",
          "http://fabrikamfiberapp.azurewebsites.net/Reports",
          "True",
          "200",
          "3.3833",
          "<250ms",
          "{\"_MS.ProcessedByMetricExtractors\":\"(Name:'Requests', Ver:'1.0')\"}",
          null,
          "GET Reports/Index",
          "0qRud6jz3k0=",
          "0qRud6jz3k0=",
          "Application Insights Availability Monitoring",
          "9fc6738d-7e26-44f0-b88e-6fae8ccb6b26",
          "us-va-ash-azr_9fc6738d-7e26-44f0-b88e-6fae8ccb6b26",
          null,
          null,
          "AutoGen_49c3aea0-4641-4675-93b5-55f7a62d22d3",
          "PC",
          null,
          null,
          "52.168.8.0",
          "Boydton",
          "Virginia",
          "United States",
          null,
          "fabrikamfiberapp",
          "RD00155D5053D1",
          "cf58dcfd-0683-487c-bc84-048789bca8e5",
          "fabrikamprod",
          "5a2e4e0c-e136-4a15-9824-90ba859b0a89",
          "web:2.5.0-33031",
          "051ad4ef-0776-11e8-ac6e-e30599af6943",
          "request",
          "1"
        ],
        [
          "2018-02-01T17:33:15.786Z",
          "|x/Ysh+M1TfU=.c32c265a_",
          null,
          "GET Home/Index",
          "http://fabrikamfiberapp.azurewebsites.net/",
          "True",
          "200",
          "716.2912",
          "500ms-1sec",
          "{\"_MS.ProcessedByMetricExtractors\":\"(Name:'Requests', Ver:'1.0')\"}",
          null,
          "GET Home/Index",
          "x/Ysh+M1TfU=",
          "x/Ysh+M1TfU=",
          "Application Insights Availability Monitoring",
          "58b15be6-d1e6-4d89-9919-52f63b840913",
          "emea-se-sto-edge_58b15be6-d1e6-4d89-9919-52f63b840913",
          null,
          null,
          "AutoGen_49c3aea0-4641-4675-93b5-55f7a62d22d3",
          "PC",
          null,
          null,
          "51.141.32.0",
          "Cardiff",
          "Cardiff",
          "United Kingdom",
          null,
          "fabrikamfiberapp",
          "RD00155D5053D1",
          "cf58dcfd-0683-487c-bc84-048789bca8e5",
          "fabrikamprod",
          "5a2e4e0c-e136-4a15-9824-90ba859b0a89",
          "web:2.5.0-33031",
          "051ad4f0-0776-11e8-ac6e-e30599af6943",
          "request",
          "1"
        ]
      ]
    }
  ]
}

Tanımlar

Name Description
column

Tablo sütunu.

errorDetail

Hata ayrıntıları.

errorInfo

Hatanın kodu ve iletisi.

errorResponse

Hata ayrıntıları.

queryResults

Sorgu yanıtı.

table

Sorgu yanıt tablosu.

column

Tablo sütunu.

Name Tür Description
name

string

Bu sütunun adı.

type

string

Bu sütunun veri türü.

errorDetail

Hata ayrıntıları.

Name Tür Description
additionalProperties

object

code

string

Hatanın kodu.

message

string

okunabilir bir hata iletisi.

resources

string[]

Hatadan sorumlu kaynakları gösterir.

target

string

İstekteki hangi özelliğin hatadan sorumlu olduğunu gösterir.

value

string

Hatadan 'target' içindeki hangi değerin sorumlu olduğunu gösterir.

errorInfo

Hatanın kodu ve iletisi.

Name Tür Description
additionalProperties

object

code

string

Makine tarafından okunabilir bir hata kodu.

details

errorDetail[]

hata ayrıntıları.

innererror

errorInfo

Hatanın kodu ve iletisi.
İç hata ayrıntıları varsa.

message

string

okunabilir bir hata iletisi.

errorResponse

Hata ayrıntıları.

Name Tür Description
error

errorInfo

Hatanın kodu ve iletisi.
Hata ayrıntıları.

queryResults

Sorgu yanıtı.

Name Tür Description
tables

table[]

Tablo, sütun ve satır listesi.

table

Sorgu yanıt tablosu.

Name Tür Description
columns

column[]

Bu tablodaki sütunların listesi.

name

string

Tablonun adı.

rows

string[]

Bu sorgudan elde edilen satırlar.