Splunk Enterprise

Splunk Search SPL

uagraw01
Builder

Hello Splunkers !!

Below are the screenshot visualization we need to achieve through Splunk.

 

We need Ordertype on Yaxis, and  cross Ailsle distance & time on Xaxis. Please let me know how can I use this in timechart command ?

 

uagraw01_0-1681888908635.png

 

 

 

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Without the SPL you already have, it is difficult to tell you what to change. However, assuming that you already have distance in one field (distance), order type in another field (type), and time in another field (_time), and that what you actually mean is distance on the Y-axis i.e. the measurement you are wanting to show, then try this

| timechart max(distance) as distance by type
0 Karma

uagraw01
Builder

@ITWhisperer  Below are two fields as well as complete SPL

OrderType &CrossAisleDistance
=============================================

 


| datamodel ITconnection ThroughputReport flat
|search OrderStatus="Finished" AND OrderType IN(Storage, Transfer, Retrieval, "Sequenced retrieval", Relocate)
`convert_time_fields`
| search date_year="*" date_month="*" weeknum="*" day_week="*" date_hour="*" date_minute="*"
| fields _time OrderId OrderType LiftId EntryLocation LogicalDestination CrossAisleDistance ModuleId
| fillnull LiftId EntryLocation LogicalDestination value="Unknown"
| search LiftId IN("*") EntryLocation IN ("*") LogicalDestination IN ("*") | search OrderType IN("*")
| eval OrderType=if(OrderType="Sequenced retrieval","S_Ret", OrderType)
| chart count by CrossAisleDistance, OrderType limit=0
| addcoltotals labelfield=CrossAisleDistance label=Total
| eval Retrieval=if(isnull(Retrieval),0,Retrieval) , Storage=if(isnull(Storage),0,Storage) , Transfer=if(isnull(Transfer),0,Transfer), S_Ret=if(isnull(S_Ret),0,S_Ret), Relocate=if(isnull(Relocate),0,Relocate)
| eventstats last(Retrieval) as Ret, last(Storage) as store, last(Transfer) as Trans, last(S_Ret) as seqret, last(Relocate) as relo
| eval Relocate=if(isnotnull(Relocate),round((Relocate/(Ret+store+Trans+seqret+relo))*100,2),round((Relocate/relo)*100,2)), Retrieval=if(isnotnull(Retrieval),round((Retrieval/(Ret+store+Trans+seqret+relo))*100,2),round((Retrieval/Ret)*100,2)), Storage=if(isnotnull(Storage),round((Storage/(Ret+store+Trans+seqret+relo))*100,2), round((Storage/store)*100,2)), Transfer=if(isnotnull(Transfer),round((Transfer/(Ret+store+Trans+seqret+relo))*100,2), round((Transfer/Trans)*100,2)), SequencedRetrieval=if(isnotnull(S_Ret),round((S_Ret/(Ret+store+Trans+seqret+relo))*100,2),round((S_Ret/seqret)*100,2))
| where CrossAisleDistance!="Total"
| fields - Ret, store, Trans, S_Ret, seqret, relo

 

0 Karma

uagraw01
Builder

@ITWhisperer  So far my visualization is looking as below. But I want time also in the x-axis

 

uagraw01_0-1681893843689.png

 

 

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

After this point in your search

| chart count by CrossAisleDistance, OrderType limit=0

You no longer have _time available to you

0 Karma

uagraw01
Builder

@ITWhisperer I have used this in place of the "| chart count by CrossAisleDistance, OrderType limit=0" . But still is not giving the expected results


| bin _time span=1d
| stats count by CrossAisleDistance, OrderType _time
| xyseries CrossAisleDistance, OrderType _time

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
0 Karma

uagraw01
Builder

@ITWhisperer I am expecting order_type on y-axis and distance and time is on x-axis

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Axis are for "measuring" one thing at a time. Can you show a picture of what you are trying to achieve? Or perhaps, what it is that you intend the chart to be able to visualise?

0 Karma

uagraw01
Builder

Yes you are right. Now in your view can I achieve the same kind of visualization through Splunk ?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| timechart count by OrderType
0 Karma

uagraw01
Builder

@ITWhisperer In a very first screenshot I have pasted , that is the visualization which I want to achieve.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Your pasted visualisation doesn't have two things on the x-axis - if you just want time on the x-axis, it has to be in the first column

0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...