{
  "name": "IS Analytics Attempts Over Time",
  "id": "IsAnalyticsAttemptsOverTime",
  "thumbnailURL": "",
  "configs": {
    "pubsub": {
      "types": [
        "subscriber",
      ]
    },
    "options": [
      {
        "id": "widgetType",
        "title": "Widget Type",
        "type": {
          "name": "ENUM",
          "possibleValues": [
            "Overall",
            "Local",
            "Federated"
          ]
        },
        "defaultValue": "Overall"
      },
      {
        "id": "headerTitle",
        "title": "Widget Display Name",
        "type": {
          "name": "TEXT",
          "possibleValues": []
        },
        "defaultValue": "Login Attempts Over Time"
      }
    ],
    "providerConfig": {
      "configs": {
        "type": "SiddhiStoreDataProvider",
        "config": {
          "siddhiApp": "define stream ProcessedAuthenticationDataStream ( meta_tenantId int, eventId string, username string, localUsername string, userStoreDomain string, tenantDomain string, rolesCommaSeparated string, remoteIp string, region string, inboundAuthType string, serviceProvider string, rememberMeEnabled bool, forceAuthEnabled bool, passiveAuthEnabled bool, stepAuthenticator string, authenticationStep string, authStepSuccess bool, identityProvider string, identityProviderType string, isFirstLogin bool, successValue int, failureValue int, stepSuccessValue int, firstLoginValue int, timestamp long ); define stream PerUserRolesDuplicateEventStream ( meta_tenantId int, eventId string, username string, localUsername string, userStoreDomain string, tenantDomain string, rolesCommaSeparated string, remoteIp string, region string, inboundAuthType string, serviceProvider string, rememberMeEnabled bool, forceAuthEnabled bool, passiveAuthEnabled bool, stepAuthenticator string, authenticationStep string, authStepSuccess bool, identityProvider string, identityProviderType string, isFirstLogin bool, successValue int, failureValue int, stepSuccessValue int, firstLoginValue int, timestamp long, token string ); @store(type='rdbms', datasource='IS_ANALYTICS_DB', field.length='serviceProvider:100, identityProvider:100, userStoreDomain:50, region:45, token:100') define aggregation RoleAggregation from PerUserRolesDuplicateEventStream select meta_tenantId, username, serviceProvider, identityProvider, token as role, remoteIp, region, userStoreDomain, isFirstLogin, sum(successValue) as authSuccessCount, sum(failureValue) as authFailureCount, sum(stepSuccessValue) as authStepSuccessCount, sum(firstLoginValue) as authFirstSuccessCount, identityProviderType, timestamp group by username, serviceProvider, identityProvider, region, token, userStoreDomain, isFirstLogin, identityProviderType aggregate by timestamp every second ... year; @store(type='rdbms', datasource='IS_ANALYTICS_DB', field.length='serviceProvider:100, identityProvider:100, userStoreDomain:50, region:45') define aggregation AuthStatAgg from ProcessedAuthenticationDataStream select meta_tenantId, username, localUsername, rolesCommaSeparated, serviceProvider, identityProvider, remoteIp, region, userStoreDomain, isFirstLogin, sum(successValue) as authSuccessCount, sum(failureValue) as authFailureCount, sum(stepSuccessValue) as authStepSuccessCount, sum(firstLoginValue) as authFirstSuccessCount, identityProviderType, timestamp group by username, serviceProvider, identityProvider, region, userStoreDomain, isFirstLogin, identityProviderType aggregate by timestamp every second ... year;",
          "queryData": {
            "query": "from {{AggregationName}} on (sum(authSuccessCount) > 0 or sum(authFailureCount) > 0) {{filterCondition}} within {{from}}L, {{to}}L per \"{{per}}s\" select AGG_TIMESTAMP, sum(authSuccessCount) as SuccessCount, sum(authFailureCount) as FailureCount",
            "queryLocal": "from {{AggregationName}} on (sum(authStepSuccessCount) > 0 or sum(authFailureCount) > 0) and identityProviderType==\'LOCAL\' {{filterCondition}} within {{from}}L, {{to}}L per \"{{per}}s\" select AGG_TIMESTAMP, sum(authStepSuccessCount) as SuccessCount, sum(authFailureCount) as FailureCount",
            "queryFederated": "from {{AggregationName}} on (sum(authStepSuccessCount) > 0 or sum(authFailureCount) > 0) and identityProviderType==\'FEDERATED\' {{filterCondition}} within {{from}}L, {{to}}L per \"{{per}}s\" select AGG_TIMESTAMP, sum(authStepSuccessCount) as SuccessCount, sum(authFailureCount) as FailureCount"
          },
          "publishingInterval": 5,
          "purgingInterval": 60,
          "publishingLimit": 30,
          "purgingLimit": 60,
          "isPurgingEnable": false
        }
      }
    }
  }
}
