Embedding GOOGLE Search Engine in Splunk Dashboard

Embedding GOOGLE Search Engine in Splunk Dashboard

Things really look cool when we see it from distance, but when we go near to it we get to know the real problem.

In our previous post “Adding Youtube Videos in Splunk Dashboard”, we have embedded iframe in Splunk dashboard to watch the youtube videos in Splunk, we could have done the same for GOOGLE  Search Engine as well but !!!!!!! ……… A Big Secret Behind … now going to be revealed as follows:

GOOGLE !! does not allow its search page to be embedded in iframes. Hence, we can’t show GOOGLE  in an iframeMost major sites and giant banks block this feature by disabling X-Frame; if you do inspect element/Google Source Code in Google page you will get this value.

X-Frame-Options: Deny

Enabling an Iframe violates security policies intended to prevent cross-site scripting (You will never want someone to wrap your website in a Full-Page iframe and then capture your credentials (Username and Password) entered to it).

There is a workaround to this; we can only access the internal elements of an iframe if the contents are from the same domain (Including Sub domain)

Now you can embed GOOGLE Search Engine in Splunk Dashboard by following steps :

Step 1:

Open an existing dashboard where you want to add GOOGLE  Search Engine. Here we have given a sample dashboard called Google Dashboard . You can see Edit button on the top right corner of the dashboard . Click on Edit.

google1

Step 2:

After clicking Edit button you can see the Source option on the top left corner of the dashboard. Click on Source.

google2

Step 3:

You have to edit the source code of the dashboard. Here we have added a new panel in the 1st  row . In the panel we have written a simple html code and also put css code . We have added the image of GOOGLE  by html code. You can see “ How to Embed Image in Splunk Dasboard” . After making changes in the dashboard click on Save to save the changes.

google3

google4

You can also download the source code of this sample dashboard from the below.

                                                     SourceCode

Step 4:

Finally GOOGLE  Search Engine has been embedded in Splunk Dashboard. Now you can search anything in the search box . Then click on search . You will get the results as per your given input in search box.

google5

Hope this has helped you in achieving the below requirement without fail:

Embedding GOOGLE Search Engine in Splunk Dashboard

 

 Happy Splunking !!

Advertisements

4 comments

  1. It’s really ammazzzziiiinnnggggg !!!
    Very easy to implement in Splunk.
    I am waiting for the next magic in this blog.
    🙂

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.