Splunk Dev

Line Chart over _time by fieldname

ips_mandar
Builder

Hi I am trying below query to plot line chart-

index=abc |eval Time=round(endtime-starttime)|chart values(Time) as Time over _time by Type

Here there can be multiple Type values.
my problem is some _time field has multivalue Time field due to which it is not plotted on graph and I am not able to use mvexpand on Type because Type value is not fixed .
my output looks like below

_time                                     Build
29/01/2019 12:01                            2
                                            3
                                            4
29/01/2019 12:12                            5

from above only 5 value is getting plotted and others are not seen due to multivalue and here I can not apply mvexpand Build as this value can change

Tags (1)
0 Karma

jkat54
SplunkTrust
SplunkTrust

Try the stats command instead

index=abc |eval Time=round(endtime-starttime)|stats values(Time) as Time by _time Type

0 Karma

ips_mandar
Builder

Thanks for comment @jkat54
but if I try this |stats values(Time) as Time by _time Type|mvexpand Time
i will get below result

 _time                                     Type                              Time
  29/01/2019 12:01                         Build                              2
  29/01/2019 12:01                         Build                              3                  
  29/01/2019 12:01                         Build                              4                  
  29/01/2019 12:12                         Build                              5              

and If i plot line chart it will have legend as Time and Type instaead of value of Type i.e. Build
I want result as-

 _time                                     Build
  29/01/2019 12:01                            2
  29/01/2019 12:01                            3
  29/01/2019 12:01                            4
  29/01/2019 12:12                            5
0 Karma

DMohn
Motivator

add a |rename Time as Build | fields -Type and you will get your desired result

0 Karma

ips_mandar
Builder

here for example I shown Build but there can be Build and Deploy under Type

0 Karma

harishalipaka
Motivator

hi @ips_mandar
i didn't understand what do u want ,i can't see above example Type

Can u explain what u had and what do u want simply

Thanks
Harish
0 Karma

ips_mandar
Builder

So Type is fieldname and it's value can be Build or Deploy or both.
After Running this query-

index=abc |eval Time=round(endtime-starttime)|chart values(Time) as Time over _time by Type

I got below results-

_time                                     Build
 29/01/2019 12:01                            2
                                             3
                                             4
 29/01/2019 12:12                            5

But I want to have seggregated result like

_time                                     Build
 29/01/2019 12:01                            2
 29/01/2019 12:01                            3
 29/01/2019 12:01                            4
 29/01/2019 12:12                            5

This can be achieved using mvexpand Build but Build value is not fixed. so is there any other way..

0 Karma

DMohn
Motivator

Have you tried using |filldown _time ??

0 Karma

ips_mandar
Builder

thnks @DMohn but it won't help

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Laser Bananas and Edge Hubs: Exploring Operational Technology (OT) Data Through a ...

  OT is a different environment to traditional IT and can have interesting challenges when interfacing the ...

Event Series: Mastering AI Tokenomics and Splunk Agent Observability

Beyond the Black Box: Correlating AI Performance and Tokenomics with Splunk Agent Observability   As ...

span_metrics: The OpenTelemetry-Idiomatic Way to See Inside Your Services

You open a trace in Splunk Observability Cloud and everything looks fine. One root span, order-pipeline, with ...