Forum Discussion

Slumlorde_21011's avatar
Slumlorde_21011
Icon for Nimbostratus rankNimbostratus
Apr 20, 2016

Redirect Question

Trying to find the best way to load balance Kibana/Marvel(Pieces of an ELK stack). This is what I've got and what I would like to do(Not the most F5 savvy just know the basics to editing VIP/iRules/Pools):

 

3 Servers running Elasticsearch/Kibana/Marvel

 

Kibana/Marvel work off of the same port 5601

 

I'd like to have two pools:

 

kibana.somedomain.net

 

marvel.somedomain.net

 

And when you navigate to these pools it would redirect to:

 

kibana.somedomain.net/apps/kibana

 

marvel.somedomain.net/apps/marvel

 

Is this possible?

 

2 Replies

  • Yep this is a very common iRule.

    when HTTP_REQUEST {
        if {  [string tolower [HTTP::host]] equals "www.abc.com" } {
            pool abc_pool
            HTTP::uri /apps/abc[HTTP::uri]
        } elseif {  [string tolower [HTTP::host]] equals "www.cde.com" } {
            pool cde_pool
            HTTP::uri /apps/cde[HTTP::uri]
        } else {  
            pool default_pool
        }
    }
    
    • shopkeeper56_23's avatar
      shopkeeper56_23
      Icon for Cirrostratus rankCirrostratus
      Actually I think i might have miss-understood your scenario. I think what you're actually trying to do is... After the pool decision is made (presumably using an irule similar to the above) you want to append the "/apps/xyz" uri onto the HTTP request? I've updated my answer to append the URI and also direct traffic to the correct pool based on HTTP host.