{
  "name": "IS Analytics Attempts By Type",
  "id": "IsAnalyticsAttemptsByType",
  "thumbnailURL": "",
  "configs": {
    "pubsub": {
      "types": [
        "subscriber",
        "publisher"
      ],
      "publisherWidgetOutputs":[
        "header",
        "body"
      ]
    },
    "options": [
      {
        "id": "widgetType",
        "title": "Widget Type",
        "type": {
          "name": "ENUM",
          "possibleValues": [
            "Local",
            "Federated",
            "Overall"
          ]
        },
        "defaultValue": "Overall"
      },
      {
        "id": "xAxis",
        "title": "X Axis",
        "type": {
          "name": "ENUM",
          "possibleValues": [
            "Service Provider",
            "User Store Domain",
            "Role",
            "Identity Provider",
            "Username"
          ]
        },
        "defaultValue": "Username"
      },
      {
        "id": "headerTitle",
        "title": "Widget Display Name",
        "type": {
          "name": "TEXT",
          "possibleValues": []
        },
        "defaultValue": "Login Attempts By "
      }
    ],
    "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 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 aggregate by timestamp every second ... year;",
          "queryData": {
            "query": "from {{AggregationName}} {{filterCondition}} within {{from}}L, {{to}}L per \"{{per}}s\" select {{xAxisValue}}, sum({{yAxisValue}}) as {{yAxisValue}} group by {{xAxisValue}} having {{yAxisValue}} > 0"
          },
          "publishingInterval": 60
        }
      }
    }
  }
}


