Editing Kibana URL

Hi ,

I am using ELK in my tool where whenever I will upload logs it will create new index with "apache_elastic_example+random" , so with the help of random function everytime I upload logs , new index is generated and with the Kibana I am visualizing my logs.

Now I want to modify Kibana url so that whenever I upload logs ,webpage gets routed to that particular index of kibana and certain filters are prepopulated . So for that I am using the following url -

http://localhost:5601/app/kibana#/discover?_g=(filters:!(('$state':(store:globalState),meta:(alias:SnapManagerWeb,disabled:!f,index:apache_elastic_example'+random+',key:logtype,negate:!f,type:phrase,value:SnapManagerWeb),query:(match:(logtype:(query:SnapManagerWeb,type:phrase))))),refreshInterval:(display:Off,pause:!f,value:0),time:(from:now-5y,mode:quick,to:now))&_a=(columns:!(jobid,level,logtype,pid,tempMessage,tid),filters:!(),index:apache_elastic_example'+random+',interval:auto,query:(match_all:()),sort:!('@timestamp',desc))

I am not facing any error but kibana page is not getting uploaded. Can I get help on this.

Regards
Nivedita Singh

hi @nivedita_singh,

Are you trying to write this URL yourself?

When you create a new index, do you also create the corresponding index-pattern? Or do you have that index-pattern already done?

Are the filters predefined?

If you already have the index pattern and the filters are predefined, I would just use the sharing-link you get from Discover. Click the "share" button in Discover, and it will give you the correct URL. If you have filters applied, they will be part of that URL.

Hi,

Thanks for your response.
I have used the same procedure of generating the link from the share button. However , that gives me the url generated from / for the current index. I want the url generated to be generalized in a way that the same url could be used for next new index that will be named as
" apache_elastic_example+random+".

Currently i am sending my logs in zip format to elastic search using logstash. Every zip file that i upload to elastic search creates a new index in the format of

apache_elastic_example+random+

so let's say the first uploaded zip file created index - apache_elastic_exampleljfitkzcqqtn

second uploaded .zip file will create index as - apache_elastic_exampleiuglkqbgnihb

And yes, we create index and index pattern with the same logic as above. so for index

apache_elastic_exampleljfitkzcqqtn --> index pattern is apache_elastic_exampleljfitkzcqqtn

and for index

apache_elastic_exampleiuglkqbgnihb --> index pattern is apache_elastic_exampleiuglkqbgnihb

Now in order to customize the default kibana view that i get for each index, i am generating url with preset filters and that needs generalization so that each time the index used in url should match to generated index in the format of - apache_elastic_example+random+.

I hope i have not made it too complicated :smile: ).

We did this with one of our projects for a while and ran into what seemed to be a problem with the length of the URL.

As far as we could find through a week of troubleshooting it was a browser issue. I know the stated limit on URL length is 2,083 characters but as we trimmed the url down for testing it would work.

Thanks a lot for your response murli. In my case, if i use a specific index name like

ljfitkzcqqtn - the URL works.

however when we are using the random function - apache_elastic_example+random+ , to make sure that the url works for next created indexes, that is when it stops working.

Hopefully my URL isn't that big yet.

Thanks a lot for your response murli. In my case, if i use a specific index name like

ljfitkzcqqtn - the URL works.

however when we are using the random function - apache_elastic_example+random+ , to make sure that the url works for next created indexes, that is when it stops working.

Hopefully my URL isn't that big yet.

I understand what you are trying to do a little better now. I had made a bad assumption looking at the length of the URL.

How do you have the Kibana index pattern setup for this?

This should work. Do you get any kind of error? Does the dashboard show up at all?

Hi,

I have following logstash config file:

input {
file {
path => "C:/Elk/logstash/flask-file-uploader-master/sclogs/**/*.log"
start_position => "beginning"
sincedb_path => "NUL"
codec => multiline {
pattern => "^%{TIMESTAMP_ISO8601:timestamp}"
negate => true
what => previous
auto_flush_interval => 5
}

output {
stdout{

codec => rubydebug }

elasticsearch {

hosts => ["localhost:9200"]
index => "apache_elastic_example"
template => "C:\Elk\logstash\flask-file-uploader-master\apache_template.json"
template_name => "apache_elastic_example"
template_overwrite => true

}

}

So index pattern is set up with the same name as index is created in elasticsearch.

And i am not getting any error , logstash pipeline and config is working fine . But when I am launching Kibana , the webpage is not uploading without throwing error.

I am attaching the snippet of the code from where I am calling kIbana -

Hi Guys 1

I am still stuck here in KIbana url.

Any help or pointer will be appreciated.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.