Dashboards & Visualizations

How to merge two dashboards into one?

swetar
New Member

Hi,

There are two graphs, each showing status of two instances. I wanted to merge both graphs into one.
Both have the same source type and index. Can anyone suggest on this?

Thanks
alt text

0 Karma
1 Solution

DalJeanis
Legend

As well as _time, you have two different dimensions, the instance number and the various readings, so you're probably better off just putting two separate panels on the same dash. Timechart doesn't handle multiple dimensions that well, so you'd end up with the individual lines being "instance1 - cpu", "instance2 - cpu" and so on, which isn't very readable.

View solution in original post

0 Karma

DalJeanis
Legend

As well as _time, you have two different dimensions, the instance number and the various readings, so you're probably better off just putting two separate panels on the same dash. Timechart doesn't handle multiple dimensions that well, so you'd end up with the individual lines being "instance1 - cpu", "instance2 - cpu" and so on, which isn't very readable.

0 Karma

swetar
New Member

Thanks for your reply. I was able to merge both the chart in the following way..
SPL side# Sourcetype1 appendcols [search sourcetype2
then I used chart overlay to overlap both of them.alt text

0 Karma

DalJeanis
Legend

@swetar - appendcols is going to fail the moment that either query returns a different number of results. If you provide the underlying searches, then we can help you merge them in a way that will work in all scenarios.

In general, you want to aim for

(index=foo1 sourcetype=bar whatever other search terms)
OR
(index=foo2 sourcetype=baz whatever other search terms)
| fields  ... list all the fields you want to keep ...
| eval fields1 = create  any fields you need to calculate 
| timechart span=15m 
  count as nameOfFirstLine
  sum(somefield) as nameOfSecondLine    
  aggregatefunction(fields) as nameOfThirdLine
  aggregatefunction(fields) as nameOfFourthLine

The above should work under all cases,as long as the aggregate functions are operating on fields that will only be in the relevant events. You can control that either by building new fields that only exist on the right kind of record, or by using an eval in the aggregate function... which is an advanced method of coding that you may want to avoid for now.

0 Karma

swetar
New Member

@DalJeanis I m using the below SPL and its working fine ..:)

sourcetype="oracle_sourcetype1XXXXXX" | eval V_INST_NAME= case(INST_ID=="1","test1",INST_ID=="2","test2")
| where like (V_INST_NAME,"%")
|timechart span=10m first(P_COUNT) as PQ by INST_ID |rename 1 as "Parallel Count for test1" 2 as "Parallel Count for test2"
| filldown
| appendcols
[search sourcetype = oracle_sourcetype2YYYYYYY | eval V_INST_NAME= case(INST_ID=="1","test1",INST_ID=="2","test2") |where like (V_INST_NAME,"%")
| timechart span=10m first(SESSIONS_COUNT) as sessions_count by INST_ID
| rename 1 as "Session Count for test1" 2 as "Session Count for test2"
| filldown ]

0 Karma

richgalloway
SplunkTrust
SplunkTrust

@swetar, If your problem is resolved, please accept the answer to help future readers.

---
If this reply helps you, Karma would be appreciated.
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Please provide the searches for the graphs and we can try to help you merge them.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...