Azure-Sentinel icon indicating copy to clipboard operation
Azure-Sentinel copied to clipboard

Parser for Snowflake mapping error for query history

Open ri-dshin opened this issue 1 year ago • 8 comments

Describe the bug It looks like Snowflake introduced a new column called AuthN_Event_ID (ordinal 9) in Query_History log table. This then causes the mapping to be off by one for the Snowflake view. This in turn means wrong values reported and aggregated for the Snowflake workbook and the analytics queries need to be adjusted. We do not have the ability to update the KQL behind this function on the content hub and require it to be fixed.

To Reproduce Steps to reproduce the behavior:

  1. Go to Snowflake look at Total Query Time reported.
  2. Also, in the analytics KQL, to get the user name, you have to refer to the role name to get any query that uses the user name to work.

Expected behavior The Execution_Time aggregate to be corrected and all columns after Session_ID are mapped to the correct field.

Screenshots

Image

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser Firefox
  • Version 145.0.2

Smartphone (please complete the following information): N/A

Additional context Snowflake CCF Connector in Content Hub v3.0.5 Parser for Snowflake template version 1.0.1

ri-dshin avatar Dec 01 '25 15:12 ri-dshin

Hello @ri-dshin, thanks for flagging this issue. We will investigate this issue and get back to you with some updates. Thanks!

v-utpalkumar avatar Dec 02 '25 06:12 v-utpalkumar

Hey @ri-dshin ,

I'm sharing the updated parser with you, which now includes the new column "AuthN_Event_ID".

  let Snowflake_view = view () {
    Snowflake_CL
    | extend EventVendor = 'Snowflake'
    | extend EventProduct = 'Snowflake'
    | extend 
      EventStartTime = column_ifexists('START_TIME_t', ''),
      EventType = column_ifexists('EVENT_TYPE_s', ''),
      TargetUsername = column_ifexists('USER_NAME_s', ''),
      SrcDvcIpAddr = column_ifexists('CLIENT_IP_s', ''),
      QueryType = column_ifexists('QUERY_TYPE_s', ''),
      QueryText = column_ifexists('QUERY_TEXT_s',''),
      QueryExecutionStatus = column_ifexists('EXECUTION_STATUS_s', ''),
      QueryTotalElapsedTime = toreal(column_ifexists('TOTAL_ELAPSED_TIME_d', '0')),
      LoginIsSuccess = column_ifexists('IS_SUCCESS_s',''),
      QueryCreditsUsedCloudServices = toreal(column_ifexists('CREDITS_USED_CLOUD_SERVICES_d','0')),
      QueryExecutionTime = toreal(column_ifexists('EXECUTION_TIME_d','0')),
      RoleName = column_ifexists('ROLE_NAME_s','')
    | extend 
      User=TargetUsername,
      EventEndTime=iff(isnotempty(EVENT_TIMESTAMP_t), EVENT_TIMESTAMP_t, END_TIME_t)
  };
  let SnowflakeLogin_view = view () {
    SnowflakeLogin_CL
    | extend EventVendor = 'Snowflake'
    | extend EventProduct = 'Snowflake'
    | mv-expand OuterArray = todynamic(Data)
    | mv-expand innerArray = OuterArray
    | extend JsonString = tostring(innerArray)
    | extend Time = toreal(extractjson("$.EVENT_TIMESTAMP", JsonString))
    | extend
      SrcDvcIpAddr = extractjson("$.CLIENT_IP", JsonString),
      LoginClientPrivateLinkId = extractjson("$.CLIENT_PRIVATE_LINK_ID", JsonString),
      LoginConnection = extractjson("$.CONNECTION", JsonString),
      LoginErrorCode = extractjson("$.ERROR_CODE", JsonString),
      LoginErrorMessage = extractjson("$.ERROR_MESSAGE", JsonString),
      LoginEventId = extractjson("$.EVENT_ID", JsonString),
      LoginEventEndTime = unixtime_seconds_todatetime(Time),
      LoginEventType = extractjson("$.EVENT_TYPE", JsonString),
      LoginFirstAuthenticationFactor = extractjson("$.FIRST_AUTHENTICATION_FACTOR", JsonString),
      LoginIsSuccess = extractjson("$.IS_SUCCESS", JsonString),
      LoginRelatedEventId = extractjson("$.RELATED_EVENT_ID", JsonString),
      LoginReportedClientType = extractjson("$.REPORTED_CLIENT_TYPE", JsonString),
      LoginReportedClientVersion = extractjson("$.REPORTED_CLIENT_VERSION", JsonString),
      LoginSecondAuthenticationFactor = extractjson("$.SECOND_AUTHENTICATION_FACTOR", JsonString),
      TargetUsername = extractjson("$.USER_NAME", JsonString)
    | extend User = TargetUsername
  };
  let SnowflakeUserGrant_view = view () {
    SnowflakeUserGrant_CL
    | extend EventVendor = 'Snowflake'
    | extend EventProduct = 'Snowflake'
    | mv-expand OuterArray = todynamic(Data)
    | mv-expand innerArray = OuterArray
    | extend JsonString = tostring(innerArray)
    | extend
      CTime = toreal(extractjson("$.CREATED_ON", JsonString)),
      DTime = toreal(extractjson("$.DELETED_ON", JsonString))
    | extend
      UserGrantCreatedOn = unixtime_seconds_todatetime(CTime),
      UserGrantDeletedOn = unixtime_seconds_todatetime(DTime),
      UserRole = extractjson("$.ROLE", JsonString),
      UserGrantGrantedTo = extractjson("$.GRANTED_TO", JsonString),
      UserGrantGranteeName = extractjson("$.GRANTEE_NAME", JsonString),
      UserGrantGrantedBy = extractjson("$.GRANTED_BY", JsonString)
  };
  let SnowflakeMaterializedView_view = view () {
    SnowflakeMaterializedView_CL
    | extend EventVendor = 'Snowflake'
    | extend EventProduct = 'Snowflake'
    | mv-expand OuterArray = todynamic(Data)
    | mv-expand innerArray = OuterArray
    | extend JsonString = tostring(innerArray)
    | extend
      STime = toreal(extractjson("$.START_TIME", JsonString)),
      ETime = toreal(extractjson("$.END_TIME", JsonString))
    | extend
      MaterializedViewStartTime = unixtime_seconds_todatetime(STime),
      MaterializedViewEndTime = unixtime_seconds_todatetime(ETime),
      MaterializedViewCreditsUsed = extractjson("$.CREDITS_USED", JsonString),
      MaterializedViewTableId = extractjson("$.TABLE_ID", JsonString),
      MaterializedViewTableName = extractjson("$.TABLE_NAME", JsonString),
      MaterializedViewSchemaId = extractjson("$.SCHEMA_ID", JsonString),
      MaterializedViewSchemaName = extractjson("$.SCHEMA_NAME", JsonString),
      MaterializedViewDatabaseId = extractjson("$.DATABASE_ID", JsonString),
      MaterializedViewDatabaseName = extractjson("$.DATABASE_NAME", JsonString)
  };
  let SnowflakeRoles_view = view () {
    SnowflakeRoles_CL
    | extend EventVendor = 'Snowflake'
    | extend EventProduct = 'Snowflake'
    | mv-expand OuterArray = todynamic(Data)
    | mv-expand innerArray = OuterArray
    | extend JsonString = tostring(innerArray)
    | extend 
      CTime = toreal(extractjson("$.CREATED_ON", JsonString)),
      DTime = toreal(extractjson("$.DELETED_ON", JsonString))
    | extend
      RoleId = extractjson("$.ROLE_ID", JsonString),
      RoleCreatedOn = unixtime_seconds_todatetime(CTime),
      RoleDeletedOn = unixtime_seconds_todatetime(DTime),
      RoleName = extractjson("$.NAME", JsonString),
      RoleComment = extractjson("$.COMMENT", JsonString),
      RoleOwner = extractjson("$.OWNER", JsonString),
      RoleType = extractjson("$.ROLE_TYPE", JsonString),
      RoleDatabaseName = extractjson("$.ROLE_DATABASE_NAME", JsonString),
      RoleInstanceId = extractjson("$.ROLE_INSTANCE_ID", JsonString),
      OwnerRoleType = extractjson("$.OWNER_ROLE_TYPE", JsonString)
  };
  let SnowflakeRoleGrant_view = view () {
    SnowflakeRoleGrant_CL
    | extend EventVendor = 'Snowflake'
    | extend EventProduct = 'Snowflake'
    | mv-expand OuterArray = todynamic(Data)
    | mv-expand innerArray = OuterArray
    | extend JsonString = tostring(innerArray)
    | extend 
      CTime = toreal(extractjson("$.CREATED_ON", JsonString)),
      MTime = toreal(extractjson("$.MODIFIED_ON", JsonString)),
      DTime = toreal(extractjson("$.DELETED_ON", JsonString))
    | extend
      RoleGrantCreatedOn = unixtime_seconds_todatetime(CTime),
      RoleGrantModifiedOn = unixtime_seconds_todatetime(MTime),
      RoleGrantPrivilege = extractjson("$.PRIVILEGE", JsonString),
      RoleGrantGrantedOn = extractjson("$.GRANTED_ON", JsonString),
      RoleGrantName = extractjson("$.NAME", JsonString),
      RoleGrantTableCatalog = extractjson("$.TABLE_CATALOG", JsonString),
      RoleGrantTableSchema = extractjson("$.TABLE_SCHEMA", JsonString),
      RoleGrantGrantedTo = extractjson("$.GRANTED_TO", JsonString),
      RoleGrantGranteeName = extractjson("$.GRANTEE_NAME", JsonString),
      RoleGrantGrantOption = extractjson("$.GRANT_OPTION", JsonString),
      RoleGrantGrantedBy = extractjson("$.GRANTED_BY", JsonString),
      RoleGrantDeletedOn = unixtime_seconds_todatetime(DTime),
      RoleGrantGrantedByRoleType = extractjson("$.GRANTED_BY_ROLE_TYPE", JsonString),
      RoleGrantObjectInstance = extractjson("$.OBJECT_INSTANCE", JsonString)
  };
  let SnowflakeLoad_view = view () {
    SnowflakeLoad_CL
    | extend EventVendor = 'Snowflake'
    | extend EventProduct = 'Snowflake'
    | mv-expand OuterArray = todynamic(Data)
    | mv-expand innerArray = OuterArray
    | extend JsonString = tostring(innerArray)
    | extend LTime = toreal(extractjson("$.LAST_LOAD_TIME", JsonString))
    | extend
      LoadTableId = extractjson("$.TABLE_ID", JsonString),
      LoadTableName = extractjson("$.TABLE_NAME", JsonString),
      LoadSchemaId = extractjson("$.SCHEMA_ID", JsonString),
      LoadSchemaName = extractjson("$.SCHEMA_NAME", JsonString),
      LoadCatalogId = extractjson("$.CATALOG_ID", JsonString),
      LoadCatalogName = extractjson("$.CATALOG_NAME", JsonString),
      LoadFileName = extractjson("$.FILE_NAME", JsonString),
      LastLoadTime = unixtime_seconds_todatetime(LTime),
      LoadStatus = extractjson("$.STATUS", JsonString),
      LoadRowCount = extractjson("$.ROW_COUNT", JsonString),
      LoadRowParsed = extractjson("$.ROW_PARSED", JsonString),
      LoadFirstErrorMessage = extractjson("$.FIRST_ERROR_MESSAGE", JsonString),
      LoadFirstErrorLineNumber = extractjson("$.FIRST_ERROR_LINE_NUMBER", JsonString),
      LoadFirstErrorCharacterPosition = extractjson("$.FIRST_ERROR_CHARACTER_POSITION", JsonString),
      LoadFirstErrorColName = extractjson("$.FIRST_ERROR_COL_NAME", JsonString),
      LoadErrorCount = extractjson("$.ERROR_COUNT", JsonString),
      LoadErrorLimit = extractjson("$.ERROR_LIMIT", JsonString)
  };
  let SnowflakeTableStorageMetrics_view = view () {
    SnowflakeTableStorageMetrics_CL
    | extend EventVendor = 'Snowflake'
    | extend EventProduct = 'Snowflake'
    | mv-expand OuterArray = todynamic(Data)
    | mv-expand innerArray = OuterArray
    | extend JsonString = tostring(innerArray)
    | extend
      TCTime = toreal(extractjson("$.TABLE_CREATED", JsonString)),
      TDTime = toreal(extractjson("$.TABLE_DROPPED", JsonString)),
      TFTime = toreal(extractjson("$.TABLE_ENTERED_FAILSAFE", JsonString)),
      SCTime = toreal(extractjson("$.SCHEMA_CREATED", JsonString)),
      SDTime = toreal(extractjson("$.SCHEMA_DROPPED", JsonString)),
      CCTime = toreal(extractjson("$.CATALOG_CREATED", JsonString)),
      CDTime = toreal(extractjson("$.CATALOG_DROPPED", JsonString))
    | extend
      TableStorageMetricsId = extractjson("$.ID", JsonString),
      TableStorageMetricsTableName = extractjson("$.TABLE_NAME", JsonString),
      TableStorageMetricsTableSchemaId = extractjson("$.TABLE_SCHEMA_ID", JsonString),
      TableStorageMetricsTableSchema = extractjson("$.TABLE_SCHEMA", JsonString),
      TableStorageMetricsTableCatalogId = extractjson("$.TABLE_CATALOG_ID", JsonString),
      TableStorageMetricsTableCatalog = extractjson("$.TABLE_CATALOG", JsonString),
      TableStorageMetricsCloneGroupId = extractjson("$.CLONE_GROUP_ID", JsonString),
      TableStorageMetricsIsTransient = extractjson("$.IS_TRANSIENT", JsonString),
      TableStorageMetricsActiveBytes = extractjson("$.ACTIVE_BYTES", JsonString),
      TableStorageMetricsTimeTravelBytes = extractjson("$.TIME_TRAVEL_BYTES", JsonString),
      TableStorageMetricsFailsafeBytes = extractjson("$.FAILSAFE_BYTES", JsonString),
      TableStorageMetricsRetainedForCloneBytes = extractjson("$.RETAINED_FOR_CLONE_BYTES", JsonString),
      TableStorageMetricsDeleted = extractjson("$.DELETED", JsonString),
      TableStorageMetricsTableCreated = unixtime_seconds_todatetime(TCTime),
      TableStorageMetricsTableDropped = unixtime_seconds_todatetime(TDTime),
      TableStorageMetricsTableEnteredFailsafe = unixtime_seconds_todatetime(TFTime),
      TableStorageMetricsSchemaCreated = unixtime_seconds_todatetime(SCTime),
      TableStorageMetricsSchemaDropped = unixtime_seconds_todatetime(SDTime),
      TableStorageMetricsCatalogCreated = unixtime_seconds_todatetime(CCTime),
      TableStorageMetricsCatalogDropped = unixtime_seconds_todatetime(CDTime),
      TableStorageMetricsComment = extractjson("$.COMMENT", JsonString),
      TableStorageMetricsInstanceId = extractjson("$.INSTANCE_ID", JsonString)
  };
  let SnowflakeTables_view = view () {
    SnowflakeTables_CL
    | extend EventVendor = 'Snowflake'
    | extend EventProduct = 'Snowflake'
    | mv-expand OuterArray = todynamic(Data)
    | mv-expand innerArray = OuterArray
    | extend JsonString = tostring(innerArray)
    | extend
      TCTime = toreal(extractjson("$.CREATED", JsonString)),
      LATime = toreal(extractjson("$.LAST_ALTERED", JsonString)),
      LDTime = toreal(extractjson("$.LAST_DDL", JsonString)),
      TDTime = toreal(extractjson("$.DELETED", JsonString))
    | extend
      TableId = extractjson("$.TABLE_ID", JsonString),
      TableName = extractjson("$.TABLE_NAME", JsonString),
      TableSchemaId = extractjson("$.TABLE_SCHEMA_ID", JsonString),
      TableSchema = extractjson("$.TABLE_SCHEMA", JsonString),
      TableCatalogId = extractjson("$.TABLE_CATALOG_ID", JsonString),
      TableCatalog = extractjson("$.TABLE_CATALOG", JsonString),
      TableOwner = extractjson("$.TABLE_OWNER", JsonString),
      TableType = extractjson("$.TABLE_TYPE", JsonString),
      TableIsTransient = extractjson("$.IS_TRANSIENT", JsonString),
      TableIsIceberg = extractjson("$.IS_ICEBERG", JsonString),
      TableIsDynamic = extractjson("$.IS_DYNAMIC", JsonString),
      TableIsHybrid = extractjson("$.IS_HYBRID", JsonString),
      TableClusteringKey = extractjson("$.CLUSTERING_KEY", JsonString),
      TableRowCount = extractjson("$.ROW_COUNT", JsonString),
      TableBytes = extractjson("$.BYTES", JsonString),
      TableRetentionTime = extractjson("$.RETENTION_TIME", JsonString),
      TableSelfReferencingColumnName = extractjson("$.SELF_REFERENCING_COLUMN_NAME", JsonString),
      TableReferenceGeneration = extractjson("$.REFERENCE_GENERATION", JsonString),
      TableUserDefinedTypeCatalog = extractjson("$.USER_DEFINED_TYPE_CATALOG", JsonString),
      TableUserDefinedTypeSchema = extractjson("$.USER_DEFINED_TYPE_SCHEMA", JsonString),
      TableUserDefinedTypeName = extractjson("$.USER_DEFINED_TYPE_NAME", JsonString),
      TableIsInsertableInto = extractjson("$.IS_INSERTABLE_INTO", JsonString),
      TableIsTyped = extractjson("$.IS_TYPED", JsonString),
      TableCommitAction = extractjson("$.COMMIT_ACTION", JsonString),
      TableCreated = unixtime_seconds_todatetime(TCTime),
      TableLastAltered = unixtime_seconds_todatetime(LATime),
      TableLastDDL = unixtime_seconds_todatetime(LDTime),
      TableLastDDLBy = extractjson("$.LAST_DDL_BY", JsonString),
      TableDeleted = unixtime_seconds_todatetime(TDTime),
      TableAutoClusteringOn = extractjson("$.AUTO_CLUSTERING_ON", JsonString),
      TableComment = extractjson("$.COMMENT", JsonString),
      TableOwnerRoleType = extractjson("$.OWNER_ROLE_TYPE", JsonString),
      TableInstanceId = extractjson("$.INSTANCE_ID", JsonString)
  };
  let SnowflakeUsers_view = view () {
    SnowflakeUsers_CL
    | extend EventVendor = 'Snowflake'
    | extend EventProduct = 'Snowflake'
    | mv-expand OuterArray = todynamic(Data)
    | mv-expand innerArray = OuterArray
    | extend JsonString = tostring(innerArray)
    | extend
      CTime = toreal(extractjson("$.CREATED_ON", JsonString)),
      DTime = toreal(extractjson("$.DELETED_ON", JsonString)),
      BMTime = toreal(extractjson("$.BYPASS_MFA_UNTIL", JsonString)),
      LSLTime = toreal(extractjson("$.LAST_SUCCESS_LOGIN", JsonString)),
      ETime = toreal(extractjson("$.EXPIRES_AT", JsonString)),
      LUTime = toreal(extractjson("$.LOCKED_UNTIL_TIME", JsonString)),
      PLSTime = toreal(extractjson("$.PASSWORD_LAST_SET_TIME", JsonString))
    | extend
      UserId = extractjson("$.USER_ID", JsonString),
      UserName = extractjson("$.NAME", JsonString),
      UserCreatedOn = extractjson("$.CREATED_ON", JsonString),
      UserDeletedOn = extractjson("$.DELETED_ON", JsonString),
      UserLoginName = extractjson("$.LOGIN_NAME", JsonString),
      UserDisplayName = extractjson("$.DISPLAY_NAME", JsonString),
      UserFirstName = extractjson("$.FIRST_NAME", JsonString),
      UserLastName = extractjson("$.LAST_NAME", JsonString),
      UserEmail = extractjson("$.EMAIL", JsonString),
      UserMustChangePassword = extractjson("$.MUST_CHANGE_PASSWORD", JsonString),
      UserHasPassword = extractjson("$.HAS_PASSWORD", JsonString),
      UserComment = extractjson("$.COMMENT", JsonString),
      UserDisabled = extractjson("$.DISABLED", JsonString),
      UserSnowflakeLock = extractjson("$.SNOWFLAKE_LOCK", JsonString),
      UserDefaultWarehouse = extractjson("$.DEFAULT_WAREHOUSE", JsonString),
      UserDefaultNamespace = extractjson("$.DEFAULT_NAMESPACE", JsonString),
      UserDefaultRole = extractjson("$.DEFAULT_ROLE", JsonString),
      UserExtAuthnDuo = extractjson("$.EXT_AUTHN_DUO", JsonString),
      UserExtAuthnUid = extractjson("$.EXT_AUTHN_UID", JsonString),
      UserHasMFA = extractjson("$.HAS_MFA", JsonString),
      UserBypassMFAUntil = unixtime_seconds_todatetime(BMTime),
      UserLastSuccessLogin = unixtime_seconds_todatetime(LSLTime),
      UserExpiresAt = unixtime_seconds_todatetime(ETime),
      UserLockedUntilTime = unixtime_seconds_todatetime(LUTime),
      UserHasRSAPublicKey = extractjson("$.HAS_RSA_PUBLIC_KEY", JsonString),
      UserPasswordLastSetTime = unixtime_seconds_todatetime(PLSTime),
      UserOwner = extractjson("$.OWNER", JsonString),
      UserDefaultSecondaryRole = extractjson("$.DEFAULT_SECONDARY_ROLE", JsonString),
      UserType = extractjson("$.TYPE", JsonString),
      UserDatabaseName = extractjson("$.DATABASE_NAME", JsonString),
      UserDatabaseId = extractjson("$.DATABASE_ID", JsonString),
      UserSchemaName = extractjson("$.SCHEMA_NAME", JsonString),
      UserSchemaId = extractjson("$.SCHEMA_ID", JsonString)
  };
  let SnowflakeQuery_view = view () {
    SnowflakeQuery_CL
    | extend EventVendor = 'Snowflake'
    | extend EventProduct = 'Snowflake'
    | mv-expand OuterArray = todynamic(Data)
    | mv-expand innerArray = OuterArray
    | extend JsonString = tostring(innerArray)
    | extend
      QueryStartTime = unixtime_seconds_todatetime(toreal(extractjson("$.START_TIME", JsonString))),
      QueryEndTime = unixtime_seconds_todatetime(toreal(extractjson("$.END_TIME", JsonString))),
      QueryTotalElapsedTime = toreal(extractjson("$.TOTAL_ELAPSED_TIME", JsonString)),
      QueryExecutionTime = toreal(extractjson("$.EXECUTION_TIME", JsonString))
    | extend
      QueryId = extractjson("$.QUERY_ID", JsonString),
      QueryText = extractjson("$.QUERY_TEXT", JsonString),
      QueryDatabaseId = extractjson("$.DATABASE_ID", JsonString),
      QueryDatabaseName = extractjson("$.DATABASE_NAME", JsonString),
      QuerySchemaId = extractjson("$.SCHEMA_ID", JsonString),
      QuerySchemaName = extractjson("$.SCHEMA_NAME", JsonString),
      QueryType = extractjson("$.QUERY_TYPE", JsonString),
      QuerySessionId = extractjson("$.SESSION_ID", JsonString),
      QueryAuthnEventId = extractjson("$.AUTHN_EVENT_ID", JsonString),
      QueryUserName = extractjson("$.USER_NAME", JsonString),
      QueryRoleName = extractjson("$.ROLE_NAME", JsonString),
      QueryWarehouseId = extractjson("$.WAREHOUSE_ID", JsonString),
      QueryWarehouseName = extractjson("$.WAREHOUSE_NAME", JsonString),
      QueryWarehouseSize = extractjson("$.WAREHOUSE_SIZE", JsonString),
      QueryWarehouseType = extractjson("$.WAREHOUSE_TYPE", JsonString),
      QueryClusterNumber = extractjson("$.CLUSTER_NUMBER", JsonString),
      QueryTag = extractjson("$.TAG", JsonString),
      QueryBytesScanned = extractjson("$.BYTES_SCANNED", JsonString),
      QueryPercentageScannedFromCache = extractjson("$.PERCENTAGE_SCANNED_FROM_CACHE", JsonString),
      QueryBytesWritten = extractjson("$.BYTES_WRITTEN", JsonString),
      QueryBytesWrittenToResult = extractjson("$.BYTES_WRITTEN_TO_RESULT", JsonString),
      QueryBytesReadFromResult = extractjson("$.BYTES_READ_FROM_RESULT", JsonString),
      QueryRowsProduced = extractjson("$.ROWS_PRODUCED", JsonString),
      QueryRowsInserted = extractjson("$.ROWS_INSERTED", JsonString),
      QueryRowsUpdated = extractjson("$.ROWS_UPDATED", JsonString),
      QueryRowsDeleted = extractjson("$.ROWS_DELETED", JsonString),
      QueryRowsUnloaded = extractjson("$.ROWS_UNLOADED", JsonString),
      QueryBytesDeleted = extractjson("$.BYTES_DELETED", JsonString),
      QueryQueuedProvisioningTime = extractjson("$.PROVISIONING_TIME", JsonString),
      QueryQueuedRepairTime = extractjson("$.QUEUED_REPAIR_TIME", JsonString),
      QueryQueuedOverloadTime = extractjson("$.QUEUED_OVERLOAD_TIME", JsonString),
      QueryTransactionBlockedTime = extractjson("$.TRANSACTION_BLOCKED_TIME", JsonString),
      QueryOutboundDataTransferCloud = extractjson("$.OUTBOUND_DATA_TRANSFER_CLOUD", JsonString),
      QueryOutboundDataTransferRegion = extractjson("$.OUTBOUND_DATA_TRANSFER_REGION", JsonString),
      QueryOutboundDataTransferBytes = extractjson("$.OUTBOUND_DATA_TRANSFER_BYTES", JsonString),
      QueryInboundDataTransferCloud = extractjson("$.INBOUND_DATA_TRANSFER_CLOUD", JsonString),
      QueryInboundDataTransferRegion = extractjson("$.INBOUND_DATA_TRANSFER_REGION", JsonString),
      QueryInboundDataTransferBytes = extractjson("$.INBOUND_DATA_TRANSFER_BYTES", JsonString),
      QueryPartitionsScanned = extractjson("$.PARTITIONS_SCANNED", JsonString),
      QueryPartitionsTotal = extractjson("$.PARTITIONS_TOTAL", JsonString),
      QueryBytesSpilledToLocalStorage = extractjson("$.BYTES_SPILLED_TO_LOCAL_STORAGE", JsonString),
      QueryBytesSpilledToRemoteStorage = extractjson("$.BYTES_SPILLED_TO_REMOTE_STORAGE", JsonString),
      QueryBytesSentOverTheNetwork = extractjson("$.BYTES_SENT_OVER_THE_NETWORK", JsonString),
      QueryCompilationTime = extractjson("$.COMPILATION_TIME", JsonString),
      QueryExecutionStatus = extractjson("$.EXECUTION_STATUS", JsonString),
      QueryErrorCode = extractjson("$.ERROR_CODE", JsonString),
      QueryErrorMessage = extractjson("$.ERROR_MESSAGE", JsonString),
      QueryListExternalFilesTime = extractjson("$.LIST_EXTERNAL_FILES_TIME", JsonString),
      QueryCreditsUsedCloudServices = extractjson("$.CREDITS_USED_CLOUD_SERVICES", JsonString),
      QueryReleaseVersion = extractjson("$.RELEASE_VERSION", JsonString),
      QueryExternalFunctionTotalInvocations = extractjson("$.EXTERNAL_FUNCTION_TOTAL_INVOCATIONS", JsonString),
      QueryExternalFunctionTotalSentRows = extractjson("$.EXTERNAL_FUNCTION_TOTAL_SENT_ROWS", JsonString),
      QueryExternalFunctionTotalReceivedRows = extractjson("$.EXTERNAL_FUNCTION_TOTAL_RECEIVED_ROWS", JsonString),
      QueryExternalFunctionTotalSentBytes = extractjson("$.EXTERNAL_FUNCTION_TOTAL_SENT_BYTES", JsonString),
      QueryExternalFunctionTotalReceivedBytes = extractjson("$.EXTERNAL_FUNCTION_TOTAL_RECEIVED_BYTES", JsonString),
      QueryIsClientGeneratedStatement = extractjson("$.IS_CLIENT_GENERATED_STATEMENT", JsonString),
      QueryAccelerationBytesScanned = extractjson("$.ACCELERATION_BYTES_SCANNED", JsonString),
      QueryAccelerationPartitionsScanned = extractjson("$.ACCELERATION_PARTITIONS_SCANNED", JsonString),
      QueryAccelerationUpperLimitScaleFactor = extractjson("$.ACCELERATION_UPPER_LIMIT_SCALE_FACTOR", JsonString),
      QueryTransactionId = extractjson("$.TRANSACTION_ID", JsonString),
      QueryLoadPercent = extractjson("$.QUERY_LOAD_PERCENT", JsonString),
      ChildQueriesWaitTime = extractjson("$.CHILD_QUERIES_WAIT_TIME", JsonString),
      QueryRoleType = extractjson("$.ROLE_TYPE", JsonString),
      QueryHash = extractjson("$.HASH", JsonString),
      QueryHashVersion = extractjson("$.HASH_VERSION", JsonString),
      QueryParameterizedHash = extractjson("$.PARAMETERIZED_HASH", JsonString),
      QueryParameterizedHashVersion = extractjson("$.PARAMETERIZED_HASH_VERSION", JsonString),
      QuerySecondaryRoleStats = extractjson("$.SECONDARY_ROLE_STATS", JsonString),
      QueryRowsWrittenToResult = extractjson("$.ROWS_WRITTEN_TO_RESULT", JsonString),
      QueryRetryTime = extractjson("$.RETRY_TIME", JsonString),
      QueryRetryCause = extractjson("$.RETRY_CAUSE", JsonString),
      QueryFaultHandlingTime = extractjson("$.FAULT_HANDLING_TIME", JsonString),
      QueryUserType = extractjson("$.USER_TYPE", JsonString),
      QueryUserDatabaseName = extractjson("$.USER_DATABASE_NAME", JsonString),
      QueryUserDatabaseId = extractjson("$.USER_DATABASE_ID", JsonString),
      QueryUserSchemaId = extractjson("$.USER_SCHEMA_ID", JsonString),
      QueryUserSchemaName = extractjson("$.USER_SCHEMA_NAME", JsonString)
  };
  union isfuzzy=true
      (SnowflakeLogin_view),
      (SnowflakeUserGrant_view),
      (SnowflakeMaterializedView_view),
      (SnowflakeRoles_view),
      (SnowflakeRoleGrant_view),
      (SnowflakeLoad_view),
      (SnowflakeTableStorageMetrics_view),
      (SnowflakeTables_view),
      (SnowflakeUsers_view),
      (SnowflakeQuery_view)
  | extend DatabaseName = coalesce(QueryDatabaseName, UserDatabaseName, RoleDatabaseName, MaterializedViewDatabaseName)
  | extend TableNames = coalesce(TableName, MaterializedViewTableName, LoadTableName, TableStorageMetricsTableName)
  | extend EventStartTime = column_ifexists('EventStartTime', '')
  | project
      EventVendor, 
      EventProduct, 
      EventStartTime,
      LoginEventType,
      TargetUsername,
      SrcDvcIpAddr,
      User,
      LoginEventEndTime,
      LoginEventId,
      LoginReportedClientType,
      LoginReportedClientVersion,
      LoginFirstAuthenticationFactor,
      LoginSecondAuthenticationFactor,
      LoginIsSuccess,
      LoginErrorCode,
      LoginErrorMessage,
      LoginRelatedEventId,
      LoginConnection,
      LoginClientPrivateLinkId,
      UserGrantCreatedOn,
      UserGrantDeletedOn,
      UserRole,
      UserGrantGrantedTo,
      UserGrantGranteeName,
      UserGrantGrantedBy,
      MaterializedViewStartTime,
      MaterializedViewEndTime,
      MaterializedViewCreditsUsed,
      MaterializedViewTableId,
      MaterializedViewTableName,
      MaterializedViewSchemaId,
      MaterializedViewSchemaName,
      MaterializedViewDatabaseId,
      MaterializedViewDatabaseName,
      RoleId,
      RoleCreatedOn,
      RoleDeletedOn,
      RoleName,
      RoleComment,
      RoleOwner,
      RoleType,
      RoleDatabaseName,
      RoleInstanceId,
      OwnerRoleType,
      RoleGrantCreatedOn,
      RoleGrantModifiedOn,
      RoleGrantPrivilege,
      RoleGrantGrantedOn,
      RoleGrantName,
      RoleGrantTableCatalog,
      RoleGrantTableSchema,
      RoleGrantGrantedTo,
      RoleGrantGranteeName,
      RoleGrantGrantOption,
      RoleGrantGrantedBy,
      RoleGrantDeletedOn,
      RoleGrantGrantedByRoleType,
      RoleGrantObjectInstance,
      LoadTableId,
      LoadTableName,
      LoadSchemaId,
      LoadSchemaName,
      LoadCatalogId,
      LoadCatalogName,
      LoadFileName,
      LastLoadTime,
      LoadStatus,
      LoadRowCount,
      LoadRowParsed,
      LoadFirstErrorMessage,
      LoadFirstErrorLineNumber,
      LoadFirstErrorCharacterPosition,
      LoadFirstErrorColName,
      LoadErrorCount,
      LoadErrorLimit,
      TableStorageMetricsId,
      TableStorageMetricsTableName,
      TableStorageMetricsTableSchemaId,
      TableStorageMetricsTableSchema,
      TableStorageMetricsTableCatalogId,
      TableStorageMetricsTableCatalog,
      TableStorageMetricsCloneGroupId,
      TableStorageMetricsIsTransient,
      TableStorageMetricsActiveBytes,
      TableStorageMetricsTimeTravelBytes,
      TableStorageMetricsFailsafeBytes,
      TableStorageMetricsRetainedForCloneBytes,
      TableStorageMetricsDeleted,
      TableStorageMetricsTableCreated,
      TableStorageMetricsTableDropped,
      TableStorageMetricsTableEnteredFailsafe,
      TableStorageMetricsSchemaCreated,
      TableStorageMetricsSchemaDropped,
      TableStorageMetricsCatalogCreated,
      TableStorageMetricsCatalogDropped,
      TableStorageMetricsComment,
      TableStorageMetricsInstanceId,
      TableId,
      TableName,
      TableNames,
      TableSchemaId,
      TableSchema,
      TableCatalogId,
      TableCatalog,
      TableOwner,
      TableType,
      TableIsTransient,
      TableIsIceberg,
      TableIsDynamic,
      TableIsHybrid,
      TableClusteringKey,
      TableRowCount,
      TableBytes,
      TableRetentionTime,
      TableSelfReferencingColumnName,
      TableReferenceGeneration,
      TableUserDefinedTypeCatalog,
      TableUserDefinedTypeSchema,
      TableUserDefinedTypeName,
      TableIsInsertableInto,
      TableIsTyped,
      TableCommitAction,
      TableCreated,
      TableLastAltered,
      TableLastDDL,
      TableLastDDLBy,
      TableDeleted,
      TableAutoClusteringOn,
      TableComment,
      TableOwnerRoleType,
      TableInstanceId,
      UserId,
      UserName,
      UserCreatedOn,
      UserDeletedOn,
      UserLoginName,
      UserDisplayName,
      UserFirstName,
      UserLastName,
      UserEmail,
      UserMustChangePassword,
      UserHasPassword,
      UserComment,
      UserDisabled,
      UserSnowflakeLock,
      UserDefaultWarehouse,
      UserDefaultNamespace,
      UserDefaultRole,
      UserExtAuthnDuo,
      UserExtAuthnUid,
      UserHasMFA,
      UserBypassMFAUntil,
      UserLastSuccessLogin,
      UserExpiresAt,
      UserLockedUntilTime,
      UserHasRSAPublicKey,
      UserPasswordLastSetTime,
      UserOwner,
      UserDefaultSecondaryRole,
      UserType,
      UserDatabaseName,
      UserDatabaseId,
      UserSchemaName,
      UserSchemaId,
      QueryId,
      QueryText,
      QueryDatabaseId,
      QueryDatabaseName,
      QuerySchemaId,
      QuerySchemaName,
      QueryType,
      QuerySessionId,
      QueryAuthnEventId,
      QueryUserName,
      QueryRoleName,
      QueryWarehouseId,
      QueryWarehouseName,
      QueryWarehouseSize,
      QueryWarehouseType,
      QueryClusterNumber,
      QueryTag,
      QueryExecutionStatus,
      QueryErrorCode,
      QueryErrorMessage,
      QueryStartTime,
      QueryTotalElapsedTime,
      QueryBytesScanned,
      QueryPercentageScannedFromCache,
      QueryBytesWritten,
      QueryBytesWrittenToResult,
      QueryBytesReadFromResult,
      QueryRowsProduced,
      QueryRowsInserted,
      QueryRowsUpdated,
      QueryRowsDeleted,
      QueryRowsUnloaded,
      QueryBytesDeleted,
      QueryPartitionsScanned,
      QueryPartitionsTotal,
      QueryBytesSpilledToLocalStorage,
      QueryBytesSpilledToRemoteStorage,
      QueryBytesSentOverTheNetwork,
      QueryCompilationTime,
      QueryExecutionTime,
      QueryQueuedProvisioningTime,
      QueryQueuedRepairTime,
      QueryQueuedOverloadTime,
      QueryTransactionBlockedTime,
      QueryOutboundDataTransferCloud,
      QueryOutboundDataTransferRegion,
      QueryOutboundDataTransferBytes,
      QueryInboundDataTransferCloud,
      QueryInboundDataTransferRegion,
      QueryInboundDataTransferBytes,
      QueryListExternalFilesTime,
      QueryCreditsUsedCloudServices,
      QueryReleaseVersion,
      QueryExternalFunctionTotalInvocations,
      QueryExternalFunctionTotalSentRows,
      QueryExternalFunctionTotalReceivedRows,
      QueryExternalFunctionTotalSentBytes,
      QueryExternalFunctionTotalReceivedBytes,
      QueryLoadPercent,
      QueryIsClientGeneratedStatement,
      QueryAccelerationBytesScanned,
      QueryAccelerationPartitionsScanned,
      QueryAccelerationUpperLimitScaleFactor,
      QueryTransactionId,
      ChildQueriesWaitTime,
      QueryRoleType,
      QueryHash,
      QueryHashVersion,
      QueryParameterizedHash,
      QueryParameterizedHashVersion,
      QuerySecondaryRoleStats,
      QueryRowsWrittenToResult,
      QueryRetryTime,
      QueryRetryCause,
      QueryFaultHandlingTime,
      QueryUserType,
      QueryUserDatabaseName,
      QueryUserDatabaseId,
      QueryUserSchemaName,
      QueryUserSchemaId,
      DatabaseName,
      TimeGenerated

Please check to see if the parser is populating the values in the newly added field. Once you've confirmed, we can proceed with repackaging the solution so the updated parser will be available in the content hub.

Let me know if you encounter any issues while running the parser.

v-kasghosh avatar Dec 05 '25 11:12 v-kasghosh

Hi,

Thanks for the response.

I can see your are trying to use the column names and instead of ordinals but, I am afraid, this does not work.

The first issue is the missing Snowflake_CL table. On our instance of Snowflake CCF connector, we do not have this table nor do we think this is a dynamic table created at query time.

As I am not aware of the history of the connector and I don't know where this came from or whether our deployment has gone wrong (although we deployed twice already because we noticed this problem with the first deployment).

Thus when you run this, apart from a few direct assigned columns, no data is returned in the function. As in nothing in the Login, UserGrants, MaterializedView, Roles, RoleGrants, Load, StorageMetrics, Tables, Users, Query (i.e. log tables) and the resulting union does not contain much data.

[cid:36d1bc3a-553f-4563-ae14-138d862e11e5] [cid:e780456f-6499-4f02-9943-e4d37662855e] [cid:fb8f129f-8a12-4812-968a-a6316ac76dab] [cid:2a2b662c-9fa4-4d6e-9dc9-85587cbeff40] [cid:b36bff80-30a6-4a04-a925-8c72cbdcc8b2] [cid:5ff3cfcf-2103-434b-95de-2d6418b0eb0f] I think you can see. Trying to use the column names is a good idea but when the log data is ingested in to the Sentinel custom log tables, the data is added as an array with the column names lost. I would have been better had it been a name-value pair or even Json but alas. If we want to use column names, we have to create ordinal map for each of the log table where we are aggregating from, but I don't see that happening.

Perhaps you missed some code that I did not receive below?

Thank you.

Don

Don Shin Director of Cyber Security T :+44 203 021 1890M :+44 (0) 7745 200 032W : www.retailinsight.io Disclaimer: The information transmitted in this email is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this email in error, please contact us at @.*** and delete the material from your computer. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of the company. Our privacy policy can be found here www.retailinsight.io/privacy-policy. Retail Insight Ltd is registered in England and Wales as Company No. 05016533 Retail Insight Ltd, One Parkshot, Richmond, Surrey, TW9 2RD. Registered VAT No. 345793074


From: v-kasghosh @.> Sent: Friday, December 05, 2025 11:29 AM To: Azure/Azure-Sentinel @.> Cc: Don Shin @.>; Mention @.> Subject: Re: [Azure/Azure-Sentinel] Parser for Snowflake mapping error for query history (Issue #13212)

[CAUTION] This email originated from outside of the organisation.

[https://outlook.office.com/mail/inbox/id/AAkALgAAAAAAHYQDEapmEc2byACqAC%2FEWg0AlFaQMY96B0aeWtnGLELC6AALvh%2BuOwAA?nativeVersion=1.2025.1121.100]v-kasghosh left a comment (Azure/Azure-Sentinel#13212)https://github.com/Azure/Azure-Sentinel/issues/13212#issuecomment-3616498318

Hey @ri-dshinhttps://github.com/ri-dshin ,

I'm sharing the updated parser with you, which now includes the new column "AuthN_Event_ID".

let Snowflake_view = view () { Snowflake_CL | extend EventVendor = 'Snowflake' | extend EventProduct = 'Snowflake' | extend EventStartTime = column_ifexists('START_TIME_t', ''), EventType = column_ifexists('EVENT_TYPE_s', ''), TargetUsername = column_ifexists('USER_NAME_s', ''), SrcDvcIpAddr = column_ifexists('CLIENT_IP_s', ''), QueryType = column_ifexists('QUERY_TYPE_s', ''), QueryText = column_ifexists('QUERY_TEXT_s',''), QueryExecutionStatus = column_ifexists('EXECUTION_STATUS_s', ''), QueryTotalElapsedTime = toreal(column_ifexists('TOTAL_ELAPSED_TIME_d', '0')), LoginIsSuccess = column_ifexists('IS_SUCCESS_s',''), QueryCreditsUsedCloudServices = toreal(column_ifexists('CREDITS_USED_CLOUD_SERVICES_d','0')), QueryExecutionTime = toreal(column_ifexists('EXECUTION_TIME_d','0')), RoleName = column_ifexists('ROLE_NAME_s','') | extend User=TargetUsername, EventEndTime=iff(isnotempty(EVENT_TIMESTAMP_t), EVENT_TIMESTAMP_t, END_TIME_t) }; let SnowflakeLogin_view = view () { SnowflakeLogin_CL | extend EventVendor = 'Snowflake' | extend EventProduct = 'Snowflake' | mv-expand OuterArray = todynamic(Data) | mv-expand innerArray = OuterArray | extend JsonString = tostring(innerArray) | extend Time = toreal(extractjson("$.EVENT_TIMESTAMP", JsonString)) | extend SrcDvcIpAddr = extractjson("$.CLIENT_IP", JsonString), LoginClientPrivateLinkId = extractjson("$.CLIENT_PRIVATE_LINK_ID", JsonString), LoginConnection = extractjson("$.CONNECTION", JsonString), LoginErrorCode = extractjson("$.ERROR_CODE", JsonString), LoginErrorMessage = extractjson("$.ERROR_MESSAGE", JsonString), LoginEventId = extractjson("$.EVENT_ID", JsonString), LoginEventEndTime = unixtime_seconds_todatetime(Time), LoginEventType = extractjson("$.EVENT_TYPE", JsonString), LoginFirstAuthenticationFactor = extractjson("$.FIRST_AUTHENTICATION_FACTOR", JsonString), LoginIsSuccess = extractjson("$.IS_SUCCESS", JsonString), LoginRelatedEventId = extractjson("$.RELATED_EVENT_ID", JsonString), LoginReportedClientType = extractjson("$.REPORTED_CLIENT_TYPE", JsonString), LoginReportedClientVersion = extractjson("$.REPORTED_CLIENT_VERSION", JsonString), LoginSecondAuthenticationFactor = extractjson("$.SECOND_AUTHENTICATION_FACTOR", JsonString), TargetUsername = extractjson("$.USER_NAME", JsonString) | extend User = TargetUsername }; let SnowflakeUserGrant_view = view () { SnowflakeUserGrant_CL | extend EventVendor = 'Snowflake' | extend EventProduct = 'Snowflake' | mv-expand OuterArray = todynamic(Data) | mv-expand innerArray = OuterArray | extend JsonString = tostring(innerArray) | extend CTime = toreal(extractjson("$.CREATED_ON", JsonString)), DTime = toreal(extractjson("$.DELETED_ON", JsonString)) | extend UserGrantCreatedOn = unixtime_seconds_todatetime(CTime), UserGrantDeletedOn = unixtime_seconds_todatetime(DTime), UserRole = extractjson("$.ROLE", JsonString), UserGrantGrantedTo = extractjson("$.GRANTED_TO", JsonString), UserGrantGranteeName = extractjson("$.GRANTEE_NAME", JsonString), UserGrantGrantedBy = extractjson("$.GRANTED_BY", JsonString) }; let SnowflakeMaterializedView_view = view () { SnowflakeMaterializedView_CL | extend EventVendor = 'Snowflake' | extend EventProduct = 'Snowflake' | mv-expand OuterArray = todynamic(Data) | mv-expand innerArray = OuterArray | extend JsonString = tostring(innerArray) | extend STime = toreal(extractjson("$.START_TIME", JsonString)), ETime = toreal(extractjson("$.END_TIME", JsonString)) | extend MaterializedViewStartTime = unixtime_seconds_todatetime(STime), MaterializedViewEndTime = unixtime_seconds_todatetime(ETime), MaterializedViewCreditsUsed = extractjson("$.CREDITS_USED", JsonString), MaterializedViewTableId = extractjson("$.TABLE_ID", JsonString), MaterializedViewTableName = extractjson("$.TABLE_NAME", JsonString), MaterializedViewSchemaId = extractjson("$.SCHEMA_ID", JsonString), MaterializedViewSchemaName = extractjson("$.SCHEMA_NAME", JsonString), MaterializedViewDatabaseId = extractjson("$.DATABASE_ID", JsonString), MaterializedViewDatabaseName = extractjson("$.DATABASE_NAME", JsonString) }; let SnowflakeRoles_view = view () { SnowflakeRoles_CL | extend EventVendor = 'Snowflake' | extend EventProduct = 'Snowflake' | mv-expand OuterArray = todynamic(Data) | mv-expand innerArray = OuterArray | extend JsonString = tostring(innerArray) | extend CTime = toreal(extractjson("$.CREATED_ON", JsonString)), DTime = toreal(extractjson("$.DELETED_ON", JsonString)) | extend RoleId = extractjson("$.ROLE_ID", JsonString), RoleCreatedOn = unixtime_seconds_todatetime(CTime), RoleDeletedOn = unixtime_seconds_todatetime(DTime), RoleName = extractjson("$.NAME", JsonString), RoleComment = extractjson("$.COMMENT", JsonString), RoleOwner = extractjson("$.OWNER", JsonString), RoleType = extractjson("$.ROLE_TYPE", JsonString), RoleDatabaseName = extractjson("$.ROLE_DATABASE_NAME", JsonString), RoleInstanceId = extractjson("$.ROLE_INSTANCE_ID", JsonString), OwnerRoleType = extractjson("$.OWNER_ROLE_TYPE", JsonString) }; let SnowflakeRoleGrant_view = view () { SnowflakeRoleGrant_CL | extend EventVendor = 'Snowflake' | extend EventProduct = 'Snowflake' | mv-expand OuterArray = todynamic(Data) | mv-expand innerArray = OuterArray | extend JsonString = tostring(innerArray) | extend CTime = toreal(extractjson("$.CREATED_ON", JsonString)), MTime = toreal(extractjson("$.MODIFIED_ON", JsonString)), DTime = toreal(extractjson("$.DELETED_ON", JsonString)) | extend RoleGrantCreatedOn = unixtime_seconds_todatetime(CTime), RoleGrantModifiedOn = unixtime_seconds_todatetime(MTime), RoleGrantPrivilege = extractjson("$.PRIVILEGE", JsonString), RoleGrantGrantedOn = extractjson("$.GRANTED_ON", JsonString), RoleGrantName = extractjson("$.NAME", JsonString), RoleGrantTableCatalog = extractjson("$.TABLE_CATALOG", JsonString), RoleGrantTableSchema = extractjson("$.TABLE_SCHEMA", JsonString), RoleGrantGrantedTo = extractjson("$.GRANTED_TO", JsonString), RoleGrantGranteeName = extractjson("$.GRANTEE_NAME", JsonString), RoleGrantGrantOption = extractjson("$.GRANT_OPTION", JsonString), RoleGrantGrantedBy = extractjson("$.GRANTED_BY", JsonString), RoleGrantDeletedOn = unixtime_seconds_todatetime(DTime), RoleGrantGrantedByRoleType = extractjson("$.GRANTED_BY_ROLE_TYPE", JsonString), RoleGrantObjectInstance = extractjson("$.OBJECT_INSTANCE", JsonString) }; let SnowflakeLoad_view = view () { SnowflakeLoad_CL | extend EventVendor = 'Snowflake' | extend EventProduct = 'Snowflake' | mv-expand OuterArray = todynamic(Data) | mv-expand innerArray = OuterArray | extend JsonString = tostring(innerArray) | extend LTime = toreal(extractjson("$.LAST_LOAD_TIME", JsonString)) | extend LoadTableId = extractjson("$.TABLE_ID", JsonString), LoadTableName = extractjson("$.TABLE_NAME", JsonString), LoadSchemaId = extractjson("$.SCHEMA_ID", JsonString), LoadSchemaName = extractjson("$.SCHEMA_NAME", JsonString), LoadCatalogId = extractjson("$.CATALOG_ID", JsonString), LoadCatalogName = extractjson("$.CATALOG_NAME", JsonString), LoadFileName = extractjson("$.FILE_NAME", JsonString), LastLoadTime = unixtime_seconds_todatetime(LTime), LoadStatus = extractjson("$.STATUS", JsonString), LoadRowCount = extractjson("$.ROW_COUNT", JsonString), LoadRowParsed = extractjson("$.ROW_PARSED", JsonString), LoadFirstErrorMessage = extractjson("$.FIRST_ERROR_MESSAGE", JsonString), LoadFirstErrorLineNumber = extractjson("$.FIRST_ERROR_LINE_NUMBER", JsonString), LoadFirstErrorCharacterPosition = extractjson("$.FIRST_ERROR_CHARACTER_POSITION", JsonString), LoadFirstErrorColName = extractjson("$.FIRST_ERROR_COL_NAME", JsonString), LoadErrorCount = extractjson("$.ERROR_COUNT", JsonString), LoadErrorLimit = extractjson("$.ERROR_LIMIT", JsonString) }; let SnowflakeTableStorageMetrics_view = view () { SnowflakeTableStorageMetrics_CL | extend EventVendor = 'Snowflake' | extend EventProduct = 'Snowflake' | mv-expand OuterArray = todynamic(Data) | mv-expand innerArray = OuterArray | extend JsonString = tostring(innerArray) | extend TCTime = toreal(extractjson("$.TABLE_CREATED", JsonString)), TDTime = toreal(extractjson("$.TABLE_DROPPED", JsonString)), TFTime = toreal(extractjson("$.TABLE_ENTERED_FAILSAFE", JsonString)), SCTime = toreal(extractjson("$.SCHEMA_CREATED", JsonString)), SDTime = toreal(extractjson("$.SCHEMA_DROPPED", JsonString)), CCTime = toreal(extractjson("$.CATALOG_CREATED", JsonString)), CDTime = toreal(extractjson("$.CATALOG_DROPPED", JsonString)) | extend TableStorageMetricsId = extractjson("$.ID", JsonString), TableStorageMetricsTableName = extractjson("$.TABLE_NAME", JsonString), TableStorageMetricsTableSchemaId = extractjson("$.TABLE_SCHEMA_ID", JsonString), TableStorageMetricsTableSchema = extractjson("$.TABLE_SCHEMA", JsonString), TableStorageMetricsTableCatalogId = extractjson("$.TABLE_CATALOG_ID", JsonString), TableStorageMetricsTableCatalog = extractjson("$.TABLE_CATALOG", JsonString), TableStorageMetricsCloneGroupId = extractjson("$.CLONE_GROUP_ID", JsonString), TableStorageMetricsIsTransient = extractjson("$.IS_TRANSIENT", JsonString), TableStorageMetricsActiveBytes = extractjson("$.ACTIVE_BYTES", JsonString), TableStorageMetricsTimeTravelBytes = extractjson("$.TIME_TRAVEL_BYTES", JsonString), TableStorageMetricsFailsafeBytes = extractjson("$.FAILSAFE_BYTES", JsonString), TableStorageMetricsRetainedForCloneBytes = extractjson("$.RETAINED_FOR_CLONE_BYTES", JsonString), TableStorageMetricsDeleted = extractjson("$.DELETED", JsonString), TableStorageMetricsTableCreated = unixtime_seconds_todatetime(TCTime), TableStorageMetricsTableDropped = unixtime_seconds_todatetime(TDTime), TableStorageMetricsTableEnteredFailsafe = unixtime_seconds_todatetime(TFTime), TableStorageMetricsSchemaCreated = unixtime_seconds_todatetime(SCTime), TableStorageMetricsSchemaDropped = unixtime_seconds_todatetime(SDTime), TableStorageMetricsCatalogCreated = unixtime_seconds_todatetime(CCTime), TableStorageMetricsCatalogDropped = unixtime_seconds_todatetime(CDTime), TableStorageMetricsComment = extractjson("$.COMMENT", JsonString), TableStorageMetricsInstanceId = extractjson("$.INSTANCE_ID", JsonString) }; let SnowflakeTables_view = view () { SnowflakeTables_CL | extend EventVendor = 'Snowflake' | extend EventProduct = 'Snowflake' | mv-expand OuterArray = todynamic(Data) | mv-expand innerArray = OuterArray | extend JsonString = tostring(innerArray) | extend TCTime = toreal(extractjson("$.CREATED", JsonString)), LATime = toreal(extractjson("$.LAST_ALTERED", JsonString)), LDTime = toreal(extractjson("$.LAST_DDL", JsonString)), TDTime = toreal(extractjson("$.DELETED", JsonString)) | extend TableId = extractjson("$.TABLE_ID", JsonString), TableName = extractjson("$.TABLE_NAME", JsonString), TableSchemaId = extractjson("$.TABLE_SCHEMA_ID", JsonString), TableSchema = extractjson("$.TABLE_SCHEMA", JsonString), TableCatalogId = extractjson("$.TABLE_CATALOG_ID", JsonString), TableCatalog = extractjson("$.TABLE_CATALOG", JsonString), TableOwner = extractjson("$.TABLE_OWNER", JsonString), TableType = extractjson("$.TABLE_TYPE", JsonString), TableIsTransient = extractjson("$.IS_TRANSIENT", JsonString), TableIsIceberg = extractjson("$.IS_ICEBERG", JsonString), TableIsDynamic = extractjson("$.IS_DYNAMIC", JsonString), TableIsHybrid = extractjson("$.IS_HYBRID", JsonString), TableClusteringKey = extractjson("$.CLUSTERING_KEY", JsonString), TableRowCount = extractjson("$.ROW_COUNT", JsonString), TableBytes = extractjson("$.BYTES", JsonString), TableRetentionTime = extractjson("$.RETENTION_TIME", JsonString), TableSelfReferencingColumnName = extractjson("$.SELF_REFERENCING_COLUMN_NAME", JsonString), TableReferenceGeneration = extractjson("$.REFERENCE_GENERATION", JsonString), TableUserDefinedTypeCatalog = extractjson("$.USER_DEFINED_TYPE_CATALOG", JsonString), TableUserDefinedTypeSchema = extractjson("$.USER_DEFINED_TYPE_SCHEMA", JsonString), TableUserDefinedTypeName = extractjson("$.USER_DEFINED_TYPE_NAME", JsonString), TableIsInsertableInto = extractjson("$.IS_INSERTABLE_INTO", JsonString), TableIsTyped = extractjson("$.IS_TYPED", JsonString), TableCommitAction = extractjson("$.COMMIT_ACTION", JsonString), TableCreated = unixtime_seconds_todatetime(TCTime), TableLastAltered = unixtime_seconds_todatetime(LATime), TableLastDDL = unixtime_seconds_todatetime(LDTime), TableLastDDLBy = extractjson("$.LAST_DDL_BY", JsonString), TableDeleted = unixtime_seconds_todatetime(TDTime), TableAutoClusteringOn = extractjson("$.AUTO_CLUSTERING_ON", JsonString), TableComment = extractjson("$.COMMENT", JsonString), TableOwnerRoleType = extractjson("$.OWNER_ROLE_TYPE", JsonString), TableInstanceId = extractjson("$.INSTANCE_ID", JsonString) }; let SnowflakeUsers_view = view () { SnowflakeUsers_CL | extend EventVendor = 'Snowflake' | extend EventProduct = 'Snowflake' | mv-expand OuterArray = todynamic(Data) | mv-expand innerArray = OuterArray | extend JsonString = tostring(innerArray) | extend CTime = toreal(extractjson("$.CREATED_ON", JsonString)), DTime = toreal(extractjson("$.DELETED_ON", JsonString)), BMTime = toreal(extractjson("$.BYPASS_MFA_UNTIL", JsonString)), LSLTime = toreal(extractjson("$.LAST_SUCCESS_LOGIN", JsonString)), ETime = toreal(extractjson("$.EXPIRES_AT", JsonString)), LUTime = toreal(extractjson("$.LOCKED_UNTIL_TIME", JsonString)), PLSTime = toreal(extractjson("$.PASSWORD_LAST_SET_TIME", JsonString)) | extend UserId = extractjson("$.USER_ID", JsonString), UserName = extractjson("$.NAME", JsonString), UserCreatedOn = extractjson("$.CREATED_ON", JsonString), UserDeletedOn = extractjson("$.DELETED_ON", JsonString), UserLoginName = extractjson("$.LOGIN_NAME", JsonString), UserDisplayName = extractjson("$.DISPLAY_NAME", JsonString), UserFirstName = extractjson("$.FIRST_NAME", JsonString), UserLastName = extractjson("$.LAST_NAME", JsonString), UserEmail = extractjson("$.EMAIL", JsonString), UserMustChangePassword = extractjson("$.MUST_CHANGE_PASSWORD", JsonString), UserHasPassword = extractjson("$.HAS_PASSWORD", JsonString), UserComment = extractjson("$.COMMENT", JsonString), UserDisabled = extractjson("$.DISABLED", JsonString), UserSnowflakeLock = extractjson("$.SNOWFLAKE_LOCK", JsonString), UserDefaultWarehouse = extractjson("$.DEFAULT_WAREHOUSE", JsonString), UserDefaultNamespace = extractjson("$.DEFAULT_NAMESPACE", JsonString), UserDefaultRole = extractjson("$.DEFAULT_ROLE", JsonString), UserExtAuthnDuo = extractjson("$.EXT_AUTHN_DUO", JsonString), UserExtAuthnUid = extractjson("$.EXT_AUTHN_UID", JsonString), UserHasMFA = extractjson("$.HAS_MFA", JsonString), UserBypassMFAUntil = unixtime_seconds_todatetime(BMTime), UserLastSuccessLogin = unixtime_seconds_todatetime(LSLTime), UserExpiresAt = unixtime_seconds_todatetime(ETime), UserLockedUntilTime = unixtime_seconds_todatetime(LUTime), UserHasRSAPublicKey = extractjson("$.HAS_RSA_PUBLIC_KEY", JsonString), UserPasswordLastSetTime = unixtime_seconds_todatetime(PLSTime), UserOwner = extractjson("$.OWNER", JsonString), UserDefaultSecondaryRole = extractjson("$.DEFAULT_SECONDARY_ROLE", JsonString), UserType = extractjson("$.TYPE", JsonString), UserDatabaseName = extractjson("$.DATABASE_NAME", JsonString), UserDatabaseId = extractjson("$.DATABASE_ID", JsonString), UserSchemaName = extractjson("$.SCHEMA_NAME", JsonString), UserSchemaId = extractjson("$.SCHEMA_ID", JsonString) }; let SnowflakeQuery_view = view () { SnowflakeQuery_CL | extend EventVendor = 'Snowflake' | extend EventProduct = 'Snowflake' | mv-expand OuterArray = todynamic(Data) | mv-expand innerArray = OuterArray | extend JsonString = tostring(innerArray) | extend QueryStartTime = unixtime_seconds_todatetime(toreal(extractjson("$.START_TIME", JsonString))), QueryEndTime = unixtime_seconds_todatetime(toreal(extractjson("$.END_TIME", JsonString))), QueryTotalElapsedTime = toreal(extractjson("$.TOTAL_ELAPSED_TIME", JsonString)), QueryExecutionTime = toreal(extractjson("$.EXECUTION_TIME", JsonString)) | extend QueryId = extractjson("$.QUERY_ID", JsonString), QueryText = extractjson("$.QUERY_TEXT", JsonString), QueryDatabaseId = extractjson("$.DATABASE_ID", JsonString), QueryDatabaseName = extractjson("$.DATABASE_NAME", JsonString), QuerySchemaId = extractjson("$.SCHEMA_ID", JsonString), QuerySchemaName = extractjson("$.SCHEMA_NAME", JsonString), QueryType = extractjson("$.QUERY_TYPE", JsonString), QuerySessionId = extractjson("$.SESSION_ID", JsonString), QueryAuthnEventId = extractjson("$.AUTHN_EVENT_ID", JsonString), QueryUserName = extractjson("$.USER_NAME", JsonString), QueryRoleName = extractjson("$.ROLE_NAME", JsonString), QueryWarehouseId = extractjson("$.WAREHOUSE_ID", JsonString), QueryWarehouseName = extractjson("$.WAREHOUSE_NAME", JsonString), QueryWarehouseSize = extractjson("$.WAREHOUSE_SIZE", JsonString), QueryWarehouseType = extractjson("$.WAREHOUSE_TYPE", JsonString), QueryClusterNumber = extractjson("$.CLUSTER_NUMBER", JsonString), QueryTag = extractjson("$.TAG", JsonString), QueryBytesScanned = extractjson("$.BYTES_SCANNED", JsonString), QueryPercentageScannedFromCache = extractjson("$.PERCENTAGE_SCANNED_FROM_CACHE", JsonString), QueryBytesWritten = extractjson("$.BYTES_WRITTEN", JsonString), QueryBytesWrittenToResult = extractjson("$.BYTES_WRITTEN_TO_RESULT", JsonString), QueryBytesReadFromResult = extractjson("$.BYTES_READ_FROM_RESULT", JsonString), QueryRowsProduced = extractjson("$.ROWS_PRODUCED", JsonString), QueryRowsInserted = extractjson("$.ROWS_INSERTED", JsonString), QueryRowsUpdated = extractjson("$.ROWS_UPDATED", JsonString), QueryRowsDeleted = extractjson("$.ROWS_DELETED", JsonString), QueryRowsUnloaded = extractjson("$.ROWS_UNLOADED", JsonString), QueryBytesDeleted = extractjson("$.BYTES_DELETED", JsonString), QueryQueuedProvisioningTime = extractjson("$.PROVISIONING_TIME", JsonString), QueryQueuedRepairTime = extractjson("$.QUEUED_REPAIR_TIME", JsonString), QueryQueuedOverloadTime = extractjson("$.QUEUED_OVERLOAD_TIME", JsonString), QueryTransactionBlockedTime = extractjson("$.TRANSACTION_BLOCKED_TIME", JsonString), QueryOutboundDataTransferCloud = extractjson("$.OUTBOUND_DATA_TRANSFER_CLOUD", JsonString), QueryOutboundDataTransferRegion = extractjson("$.OUTBOUND_DATA_TRANSFER_REGION", JsonString), QueryOutboundDataTransferBytes = extractjson("$.OUTBOUND_DATA_TRANSFER_BYTES", JsonString), QueryInboundDataTransferCloud = extractjson("$.INBOUND_DATA_TRANSFER_CLOUD", JsonString), QueryInboundDataTransferRegion = extractjson("$.INBOUND_DATA_TRANSFER_REGION", JsonString), QueryInboundDataTransferBytes = extractjson("$.INBOUND_DATA_TRANSFER_BYTES", JsonString), QueryPartitionsScanned = extractjson("$.PARTITIONS_SCANNED", JsonString), QueryPartitionsTotal = extractjson("$.PARTITIONS_TOTAL", JsonString), QueryBytesSpilledToLocalStorage = extractjson("$.BYTES_SPILLED_TO_LOCAL_STORAGE", JsonString), QueryBytesSpilledToRemoteStorage = extractjson("$.BYTES_SPILLED_TO_REMOTE_STORAGE", JsonString), QueryBytesSentOverTheNetwork = extractjson("$.BYTES_SENT_OVER_THE_NETWORK", JsonString), QueryCompilationTime = extractjson("$.COMPILATION_TIME", JsonString), QueryExecutionStatus = extractjson("$.EXECUTION_STATUS", JsonString), QueryErrorCode = extractjson("$.ERROR_CODE", JsonString), QueryErrorMessage = extractjson("$.ERROR_MESSAGE", JsonString), QueryListExternalFilesTime = extractjson("$.LIST_EXTERNAL_FILES_TIME", JsonString), QueryCreditsUsedCloudServices = extractjson("$.CREDITS_USED_CLOUD_SERVICES", JsonString), QueryReleaseVersion = extractjson("$.RELEASE_VERSION", JsonString), QueryExternalFunctionTotalInvocations = extractjson("$.EXTERNAL_FUNCTION_TOTAL_INVOCATIONS", JsonString), QueryExternalFunctionTotalSentRows = extractjson("$.EXTERNAL_FUNCTION_TOTAL_SENT_ROWS", JsonString), QueryExternalFunctionTotalReceivedRows = extractjson("$.EXTERNAL_FUNCTION_TOTAL_RECEIVED_ROWS", JsonString), QueryExternalFunctionTotalSentBytes = extractjson("$.EXTERNAL_FUNCTION_TOTAL_SENT_BYTES", JsonString), QueryExternalFunctionTotalReceivedBytes = extractjson("$.EXTERNAL_FUNCTION_TOTAL_RECEIVED_BYTES", JsonString), QueryIsClientGeneratedStatement = extractjson("$.IS_CLIENT_GENERATED_STATEMENT", JsonString), QueryAccelerationBytesScanned = extractjson("$.ACCELERATION_BYTES_SCANNED", JsonString), QueryAccelerationPartitionsScanned = extractjson("$.ACCELERATION_PARTITIONS_SCANNED", JsonString), QueryAccelerationUpperLimitScaleFactor = extractjson("$.ACCELERATION_UPPER_LIMIT_SCALE_FACTOR", JsonString), QueryTransactionId = extractjson("$.TRANSACTION_ID", JsonString), QueryLoadPercent = extractjson("$.QUERY_LOAD_PERCENT", JsonString), ChildQueriesWaitTime = extractjson("$.CHILD_QUERIES_WAIT_TIME", JsonString), QueryRoleType = extractjson("$.ROLE_TYPE", JsonString), QueryHash = extractjson("$.HASH", JsonString), QueryHashVersion = extractjson("$.HASH_VERSION", JsonString), QueryParameterizedHash = extractjson("$.PARAMETERIZED_HASH", JsonString), QueryParameterizedHashVersion = extractjson("$.PARAMETERIZED_HASH_VERSION", JsonString), QuerySecondaryRoleStats = extractjson("$.SECONDARY_ROLE_STATS", JsonString), QueryRowsWrittenToResult = extractjson("$.ROWS_WRITTEN_TO_RESULT", JsonString), QueryRetryTime = extractjson("$.RETRY_TIME", JsonString), QueryRetryCause = extractjson("$.RETRY_CAUSE", JsonString), QueryFaultHandlingTime = extractjson("$.FAULT_HANDLING_TIME", JsonString), QueryUserType = extractjson("$.USER_TYPE", JsonString), QueryUserDatabaseName = extractjson("$.USER_DATABASE_NAME", JsonString), QueryUserDatabaseId = extractjson("$.USER_DATABASE_ID", JsonString), QueryUserSchemaId = extractjson("$.USER_SCHEMA_ID", JsonString), QueryUserSchemaName = extractjson("$.USER_SCHEMA_NAME", JsonString) }; union isfuzzy=true (SnowflakeLogin_view), (SnowflakeUserGrant_view), (SnowflakeMaterializedView_view), (SnowflakeRoles_view), (SnowflakeRoleGrant_view), (SnowflakeLoad_view), (SnowflakeTableStorageMetrics_view), (SnowflakeTables_view), (SnowflakeUsers_view), (SnowflakeQuery_view) | extend DatabaseName = coalesce(QueryDatabaseName, UserDatabaseName, RoleDatabaseName, MaterializedViewDatabaseName) | extend TableNames = coalesce(TableName, MaterializedViewTableName, LoadTableName, TableStorageMetricsTableName) | extend EventStartTime = column_ifexists('EventStartTime', '') | project EventVendor, EventProduct, EventStartTime, LoginEventType, TargetUsername, SrcDvcIpAddr, User, LoginEventEndTime, LoginEventId, LoginReportedClientType, LoginReportedClientVersion, LoginFirstAuthenticationFactor, LoginSecondAuthenticationFactor, LoginIsSuccess, LoginErrorCode, LoginErrorMessage, LoginRelatedEventId, LoginConnection, LoginClientPrivateLinkId, UserGrantCreatedOn, UserGrantDeletedOn, UserRole, UserGrantGrantedTo, UserGrantGranteeName, UserGrantGrantedBy, MaterializedViewStartTime, MaterializedViewEndTime, MaterializedViewCreditsUsed, MaterializedViewTableId, MaterializedViewTableName, MaterializedViewSchemaId, MaterializedViewSchemaName, MaterializedViewDatabaseId, MaterializedViewDatabaseName, RoleId, RoleCreatedOn, RoleDeletedOn, RoleName, RoleComment, RoleOwner, RoleType, RoleDatabaseName, RoleInstanceId, OwnerRoleType, RoleGrantCreatedOn, RoleGrantModifiedOn, RoleGrantPrivilege, RoleGrantGrantedOn, RoleGrantName, RoleGrantTableCatalog, RoleGrantTableSchema, RoleGrantGrantedTo, RoleGrantGranteeName, RoleGrantGrantOption, RoleGrantGrantedBy, RoleGrantDeletedOn, RoleGrantGrantedByRoleType, RoleGrantObjectInstance, LoadTableId, LoadTableName, LoadSchemaId, LoadSchemaName, LoadCatalogId, LoadCatalogName, LoadFileName, LastLoadTime, LoadStatus, LoadRowCount, LoadRowParsed, LoadFirstErrorMessage, LoadFirstErrorLineNumber, LoadFirstErrorCharacterPosition, LoadFirstErrorColName, LoadErrorCount, LoadErrorLimit, TableStorageMetricsId, TableStorageMetricsTableName, TableStorageMetricsTableSchemaId, TableStorageMetricsTableSchema, TableStorageMetricsTableCatalogId, TableStorageMetricsTableCatalog, TableStorageMetricsCloneGroupId, TableStorageMetricsIsTransient, TableStorageMetricsActiveBytes, TableStorageMetricsTimeTravelBytes, TableStorageMetricsFailsafeBytes, TableStorageMetricsRetainedForCloneBytes, TableStorageMetricsDeleted, TableStorageMetricsTableCreated, TableStorageMetricsTableDropped, TableStorageMetricsTableEnteredFailsafe, TableStorageMetricsSchemaCreated, TableStorageMetricsSchemaDropped, TableStorageMetricsCatalogCreated, TableStorageMetricsCatalogDropped, TableStorageMetricsComment, TableStorageMetricsInstanceId, TableId, TableName, TableNames, TableSchemaId, TableSchema, TableCatalogId, TableCatalog, TableOwner, TableType, TableIsTransient, TableIsIceberg, TableIsDynamic, TableIsHybrid, TableClusteringKey, TableRowCount, TableBytes, TableRetentionTime, TableSelfReferencingColumnName, TableReferenceGeneration, TableUserDefinedTypeCatalog, TableUserDefinedTypeSchema, TableUserDefinedTypeName, TableIsInsertableInto, TableIsTyped, TableCommitAction, TableCreated, TableLastAltered, TableLastDDL, TableLastDDLBy, TableDeleted, TableAutoClusteringOn, TableComment, TableOwnerRoleType, TableInstanceId, UserId, UserName, UserCreatedOn, UserDeletedOn, UserLoginName, UserDisplayName, UserFirstName, UserLastName, UserEmail, UserMustChangePassword, UserHasPassword, UserComment, UserDisabled, UserSnowflakeLock, UserDefaultWarehouse, UserDefaultNamespace, UserDefaultRole, UserExtAuthnDuo, UserExtAuthnUid, UserHasMFA, UserBypassMFAUntil, UserLastSuccessLogin, UserExpiresAt, UserLockedUntilTime, UserHasRSAPublicKey, UserPasswordLastSetTime, UserOwner, UserDefaultSecondaryRole, UserType, UserDatabaseName, UserDatabaseId, UserSchemaName, UserSchemaId, QueryId, QueryText, QueryDatabaseId, QueryDatabaseName, QuerySchemaId, QuerySchemaName, QueryType, QuerySessionId, QueryAuthnEventId, QueryUserName, QueryRoleName, QueryWarehouseId, QueryWarehouseName, QueryWarehouseSize, QueryWarehouseType, QueryClusterNumber, QueryTag, QueryExecutionStatus, QueryErrorCode, QueryErrorMessage, QueryStartTime, QueryTotalElapsedTime, QueryBytesScanned, QueryPercentageScannedFromCache, QueryBytesWritten, QueryBytesWrittenToResult, QueryBytesReadFromResult, QueryRowsProduced, QueryRowsInserted, QueryRowsUpdated, QueryRowsDeleted, QueryRowsUnloaded, QueryBytesDeleted, QueryPartitionsScanned, QueryPartitionsTotal, QueryBytesSpilledToLocalStorage, QueryBytesSpilledToRemoteStorage, QueryBytesSentOverTheNetwork, QueryCompilationTime, QueryExecutionTime, QueryQueuedProvisioningTime, QueryQueuedRepairTime, QueryQueuedOverloadTime, QueryTransactionBlockedTime, QueryOutboundDataTransferCloud, QueryOutboundDataTransferRegion, QueryOutboundDataTransferBytes, QueryInboundDataTransferCloud, QueryInboundDataTransferRegion, QueryInboundDataTransferBytes, QueryListExternalFilesTime, QueryCreditsUsedCloudServices, QueryReleaseVersion, QueryExternalFunctionTotalInvocations, QueryExternalFunctionTotalSentRows, QueryExternalFunctionTotalReceivedRows, QueryExternalFunctionTotalSentBytes, QueryExternalFunctionTotalReceivedBytes, QueryLoadPercent, QueryIsClientGeneratedStatement, QueryAccelerationBytesScanned, QueryAccelerationPartitionsScanned, QueryAccelerationUpperLimitScaleFactor, QueryTransactionId, ChildQueriesWaitTime, QueryRoleType, QueryHash, QueryHashVersion, QueryParameterizedHash, QueryParameterizedHashVersion, QuerySecondaryRoleStats, QueryRowsWrittenToResult, QueryRetryTime, QueryRetryCause, QueryFaultHandlingTime, QueryUserType, QueryUserDatabaseName, QueryUserDatabaseId, QueryUserSchemaName, QueryUserSchemaId, DatabaseName, TimeGenerated

Please check to see if the parser is populating the values in the newly added field. Let me know if you encounter any issues while running the parser.

Reply to this email directly, view it on GitHubhttps://github.com/Azure/Azure-Sentinel/issues/13212#issuecomment-3616498318, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFI7YQEPKGK7DO47DP4CSTD4AFUAFAVCNFSM6AAAAACNV7NUJWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMMJWGQ4TQMZRHA. You are receiving this because you were mentioned.Message ID: @.***>

ri-dshin avatar Dec 05 '25 15:12 ri-dshin

@ri-dshin The Snowflake_CL is connected to the Azure function-based connector and not the CCF one. In CCF, each data type has its own table definition. The parser (found here: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Snowflake/Parsers/Snowflake.yaml) is the union of all tables within the content hub solution (all connectors).

The only change we have done is to move out of list-based query:

QueryId = tostring(DataList[0]),
QueryText = tostring(DataList[1]),
QueryDatabaseId = tostring(DataList[2]),

to property-based query:

QueryId = extractjson("$.QUERY_ID", JsonString),
QueryText = extractjson("$.QUERY_TEXT", JsonString),
QueryDatabaseId = extractjson("$.DATABASE_ID", JsonString),

for the same reasons that any new columns were introduced, it might break the query. However, we can confirm that the parser does not capture the newly added AUTHN_EVENT_ID and thank you for raising this. We will update the parser and share the update.

srikarshastry avatar Dec 11 '25 18:12 srikarshastry

A fix was pushed: https://github.com/Azure/Azure-Sentinel/pull/13305. We will be deploying this content hub solution update in the marketplace next.

srikarshastry avatar Dec 11 '25 21:12 srikarshastry

Hey @ri-dshin The above-mentioned PR has been reviewed and merged, so we are closing this issue. If you need further assistance, you can reopen it at any time. Thank you for your cooperation!

v-kasghosh avatar Dec 12 '25 10:12 v-kasghosh

I updated to the new version and it looks like the fix made things worse.

ri-dshin avatar Dec 12 '25 14:12 ri-dshin

@ri-dshin can you please elaborate what is the issue?

srikarshastry avatar Dec 12 '25 15:12 srikarshastry