Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable failure store in discover #183742

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

flash1293
Copy link
Contributor

@flash1293 flash1293 commented May 17, 2024

This is a POC that enables the failure store in discover.

Walkthrough (with sound):

Screen.Recording.2024-05-17.at.16.57.48.mov

To reproduce:

PUT _ingest/pipeline/counter-app
{
  "description": "Processes 100% authentic, completely real, production-grade counter data",
  "processors": [
    {
      "set": {
        "tag": "apply timestamp", 
        "field": "@timestamp",
        "override": false,
        "copy_from": "_ingest.timestamp"
      }
    },
    {
      "script": {
        "tag": "decode counter",
        "source": """
          String count = ctx['count'];
          if ('one'.equals(count)) {
            ctx['count'] = 1;
          } else if ('two'.equals(count)) {
            ctx['count'] = 2;
          } else if ('three'.equals(count)) {
            ctx['count'] = 3;
          } else if ('four'.equals(count)) {
            ctx['count'] = 4;
          } else if ('five'.equals(count)) {
            ctx['count'] = 5;
          } else {
            throw new Exception("That's not a number!");
          }
        """
      }
    }
  ]
}

PUT _index_template/counter-app
{
  "index_patterns": ["*-counter.app-*"],
  "priority": 105, 
  "data_stream": {
    "failure_store": true
  },
  "template": {
    "settings": {
      "index.default_pipeline": "counter-app"
    }, 
    "mappings": {
      "properties": {
        "count": {
          "type": "long"
        },
        "@timestamp": {
          "type": "date"
        }
      }
    }
  }
}

POST demo-counter.app-prod/_doc
{
  "count": "one"
}

POST demo-counter.app-prod/_doc
{
  "count": "two hundred"
}

When creating a data view, there is a new advanced setting (default is exclude, setting it to only will only return the error documents).

Screenshot 2024-05-17 at 15 30 08

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants