Splunk Cloud Platform

query help in splunk cloud

Praz_123
Communicator


query is something like :-
`macro_1` index=abc sequenceNumber=12 `macro_2`

basically the below image had 4 column as  and the events following there 

Praz_123_1-1755844648750.pngPraz_123_0-1755844591895.png

If we see in the events the logs are missing for the seq no 17 & 24 and time is missing 15,16,17 and 24 also there is 15 and 16 events merge together how will I solve this 

 

Labels (2)
0 Karma

isoutamo
SplunkTrust
SplunkTrust

Have you try to run this SPL with macros expanded? 
You can do it in SPL box with key combinations Ctrl+Shift+E (windows) or Cmd+Shift+E (macOS).

With that way you could modify / comment out content of those macros and debug what will happen and where is the real issue.

0 Karma

Praz_123
Communicator

@livehybrid @ITWhisperer 

macro 1:-
source="/data/splunk/layer7/*"



macro 2;-
| rex field=_raw "<detail (?<msg>[\d\D]*?)</params></detail>" max_match=150
| mvexpand msg
| rex field=msg "messageId=\"(?<Code>\S+)\"|ordinal=\"(?<SeqNo>\S+)\"|time=\"(?<DetTime>\S+)\"|<param>(?<Message>[\d\D]*?)</param>" max_match=150
| eval DetTime=DetTime/1000
| convert timeformat="%m/%d/%Y %H:%M:%S.%3Q" ctime(DetTime) AS Time
| table SeqNo, Time, Code, Message


while am running for other sequence number there is no issue for this the issue is 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Some of your messages have multiple sequence numbers (ordinals) and some have no sequence number. Try looking at the actual events which are causing you the issue and determine whether the rex needs to be updated to extract the msg field correctly to alleviate this problem

0 Karma

livehybrid
SplunkTrust
SplunkTrust

Hi @Praz_123 

Without knowing exactly what the two macros are doing its unfortunately impossible for us to know what is going on. Please can you send the expanded version of the search or the contents of the macros?

🌟 Did this answer help you? If so, please consider:

  • Adding karma to show it was useful
  • Marking it as the solution if it resolved your issue
  • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Your problem appears to be either in macro_1 or macro_2 or both

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!

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...

SPL2 Deep Dives, AppDynamics Integrations, SAML Made Simple and Much More on Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...