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

Add url format in the index pattern #3979

Closed

Conversation

monicasarbu
Copy link
Contributor

@monicasarbu monicasarbu commented Apr 10, 2017

Add the Url format in the fields.yml, in order to generate an index pattern with an Url field. The Url link is needed in order to link the beat.name to a host-specific dashboard.

Here is an example on how to make beat.name a link to a dashboard:

name: beat.name
   metricbeat.format: url
   metricbeat.params: 
       urlTemplate: "../app/kibana#/dashboard/79ffd6e0-faa0-11e6-947f-177f697178b8?_a=(query:    (query_string:(analyze_wildcard:!t,query:'beat.hostname:{{value}}'"
       labelTemplate: "{{value}}"

As a result, the host name appears as a link to the dashboard in all the tables.
screen shot 2017-04-10 at 7 35 00 pm

Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really great idea!

@@ -11,6 +11,11 @@
set in the configuration file, then that value is used. If it is not
set, the hostname is used. To set the Beat name, use the `name`
option in the configuration file.
format: url
params:
urlTemplate: "../app/kibana#/dashboard/79ffd6e0-faa0-11e6-947f-177f697178b8?_a=(query:(query_string:(analyze_wildcard:!t,query:'beat.hostname:{{value}}')))"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is is possible to give the dashboard a name that we can reference here that is not a UUID? I think that would be a little better to maintainability.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to only apply this to the metricbeat-* index pattern instead of all beats? Like other beats might want to have their own host specific dashboards.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point, Andrew. Let me see if I can do that with the current functionality.

@monicasarbu monicasarbu added v6.0.0-alpha1 and removed v5.4.0 needs_backport PR is waiting to be backported to other branches. labels Apr 10, 2017
@monicasarbu monicasarbu added the discuss Issue needs further discussion. label Apr 20, 2017
@ruflin ruflin added the in progress Pull request is currently in progress. label Apr 21, 2017
@monicasarbu monicasarbu force-pushed the export_index_pattern_with_url branch from 07949eb to d2f5f2d Compare April 21, 2017 11:48
@@ -15,6 +15,11 @@
description: >
The hostname as returned by the operating system on which the Beat is
running.
metricbeat.format: url
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible we should try not to mix beat specific things into libbeat.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only solution that I found to set a different format for beat.hostname for Metricbeat than for the other beats. Other option would be to remove it from common libbeat fields, but this is a bigger change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, lets keep it then and figure out a way in the long run how we can make this nicer. Perhaps we can somehow have it also in metricbeat in the future and merge the fields values somehow.

Do you think this will also happen to other fields then only beat.hostname or is this hostname specific?

} else {
}

if t.esVersion.major >= 5 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is also part of #4079

@monicasarbu
Copy link
Contributor Author

After discussing internally, we decided to close this PR in favor of a custom widget where the user can configure the Dashboard where a field should point to.

@monicasarbu monicasarbu deleted the export_index_pattern_with_url branch April 24, 2017 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Issue needs further discussion. in progress Pull request is currently in progress. libbeat review v6.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants