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

Kibana Links #402

Closed
anirudhraju opened this issue Aug 22, 2013 · 2 comments
Closed

Kibana Links #402

anirudhraju opened this issue Aug 22, 2013 · 2 comments

Comments

@anirudhraju
Copy link

Hey all,

Kibana has the option to filter by index (specified in the dashboard config). But is there way to filter by "type"?

I need to generate a unique kibana URL for each index and type.

How do I go about doing this?

Thanks

@rashidkpc
Copy link
Contributor

Related to #448

@rashidkpc
Copy link
Contributor

This is now possible with templated dashboards. Here's a dashboard definition that would accomplish this goal. Save it to a file under the dashboards/ directory. Eg dashboards/mydashboard.json.

You can pass it parameters as such:
http://localhost:8000/index.html#/dashboard/file/mydashboard.json?index=some_index&type=apache&query=html

In the JSON below, note the occurrences of {{ARGS.something || 'something'}}. The variable after the dot in ARGS is the name of the URL parameter. The bit after || is the value that will be used if no url parameter is passed. This definition is based on the logstash.json one, so you might need to change the occurrences of @timestamp and @message to something else.

{
  "rows": [
    {
      "title": "Options",
      "height": "30px",
      "panels": [
        {
          "type": "timepicker",
          "span": 6,
          "timespan": "1h",
          "status": "Stable",
          "mode": "relative",
          "time_options": [
            "5m",
            "15m",
            "1h",
            "6h",
            "12h",
            "24h",
            "2d",
            "7d",
            "30d"
          ],
          "timefield": "@timestamp",
          "timeformat": "",
          "refresh": {
            "enable": false,
            "interval": 30,
            "min": 3
          },
          "filter_id": 0
        },
        {
          "type": "dashcontrol",
          "span": 3,
          "save": {
            "gist": false,
            "elasticsearch": true,
            "local": true,
            "default": true
          },
          "load": {
            "gist": true,
            "elasticsearch": true,
            "local": true
          },
          "hide_control": false,
          "elasticsearch_size": 20,
          "temp": true,
          "ttl_enable": true,
          "temp_ttl": "30d"
        }
      ],
      "collapse": false,
      "collapsable": true,
      "editable": true
    },
    {
      "title": "Query",
      "height": "30px",
      "panels": [
        {
          "type": "Query",
          "label": "Search",
          "pinned": true,
          "history": [],
          "remember": 10
        }
      ],
      "collapse": false,
      "collapsable": true,
      "editable": true
    },
    {
      "title": "Filters",
      "height": "100px",
      "collapse": false,
      "panels": [
        {
          "type": "filtering"
        }
      ],
      "collapsable": true,
      "editable": true
    },
    {
      "title": "Chart",
      "height": "300px",
      "panels": [
        {
          "type": "histogram",
          "time_field": "@timestamp",
          "auto_int": true,
          "mode": "count",
          "queries": {
            "mode": "all",
            "ids": [
              0
            ]
          },
          "value_field": null,
          "resolution": 100,
          "interval": "30s",
          "fill": 0,
          "linewidth": 3,
          "timezone": "browser",
          "spyable": true,
          "zoomlinks": true,
          "bars": true,
          "stack": true,
          "points": false,
          "lines": false,
          "legend": true,
          "x-axis": true,
          "y-axis": true,
          "percentage": false,
          "interactive": true,
          "tooltip": {
            "value_type": "cumulative",
            "query_as_alias": false
          }
        }
      ],
      "collapse": false,
      "collapsable": true,
      "editable": true
    },
    {
      "title": "Events",
      "height": "400px",
      "panels": [
        {
          "type": "table",
          "fields": [
            "@timestamp",
            "@message"
          ],
          "sort": [
            "@timestamp",
            "desc"
          ],
          "overflow": "expand",
          "status": "Stable",
          "queries": {
            "mode": "all",
            "ids": [
              0
            ]
          },
          "size": 100,
          "pages": 5,
          "offset": 0,
          "group": "default",
          "style": {
            "font-size": "9pt"
          },
          "highlight": [],
          "sortable": true,
          "header": true,
          "paging": true,
          "field_list": true,
          "trimFactor": 300,
          "normTimes": true,
          "spyable": true,
          "error": false
        }
      ],
      "collapse": false,
      "collapsable": true,
      "editable": true
    }
  ],
  "services": {
    "query": {
      "list": {
        "0": {
          "query": "{{ARGS.query || '*'}}",
          "id": 0,
          "alias": "",
          "pin": false,
          "type": "lucene",
          "color": "#7EB26D"
        }
      },
      "ids": [
        0
      ]
    },
    "filter": {
      "list": {
        "0": {
          "from": "2013-09-04T20:01:42.582Z",
          "to": "2013-09-04T21:01:42.582Z",
          "field": "@timestamp",
          "type": "time",
          "mandate": "must",
          "active": true,
          "alias": "",
          "id": 0
        },
        "1": {
          "type": "field",
          "field": "_type",
          "query": "{{ARGS.type || '*'}}",
          "mandate": "must",
          "active": true,
          "alias": "",
          "id": 1
        }
      },
      "ids": [
        0,
        1
      ],
      "idQueue": []
    }
  },
  "title": "Test",
  "failover": false,
  "index": {
    "default": "{{ARGS.index || '_all'}}",
    "pattern": "NO_PATTERN",
    "interval": "none"
  },
  "style": "dark",
  "editable": true
}

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

No branches or pull requests

2 participants