Splunk Search

Why is the append query not working?

Mohsin123
Path Finder

hi,

index="idx_a" sourcetype IN ("logs") component=* logpoint=request-in 
| table transaction-id,timestamp-in| append 
    [ search index="idx_a" sourcetype IN ("logs") component=* logpoint=response-out 
    | table timestamp-out] 
| table transaction-id,timestamp-in,timestamp-out

In my last query, timestamp-out is blank.
Can anyone please help?

Tags (2)
0 Karma
1 Solution

PowerPacked
Builder

Hi @Anonymous

Are you trying to do a table of transaction-id,timestamp-in,timestamp-out with proper results,

Use the join command like this

index="idx_a" sourcetype IN ("logs") component= logpoint=request-in
| table transaction-id,timestamp-in| join transaction-id
[ search index="idx_a" sourcetype IN ("logs") component= logpoint=response-out
| table timestamp-out, transaction-id]
| table transaction-id,timestamp-in,timestamp-out

Only Join will map the transaction id with respective timestamp-in & timestamp-out.
Appendcols & append commands are used to append the results from main search to sub search, which is not a table of ordered correctly mapped data

Thanks

View solution in original post

0 Karma

PowerPacked
Builder

Hi @Anonymous

Are you trying to do a table of transaction-id,timestamp-in,timestamp-out with proper results,

Use the join command like this

index="idx_a" sourcetype IN ("logs") component= logpoint=request-in
| table transaction-id,timestamp-in| join transaction-id
[ search index="idx_a" sourcetype IN ("logs") component= logpoint=response-out
| table timestamp-out, transaction-id]
| table transaction-id,timestamp-in,timestamp-out

Only Join will map the transaction id with respective timestamp-in & timestamp-out.
Appendcols & append commands are used to append the results from main search to sub search, which is not a table of ordered correctly mapped data

Thanks

0 Karma

CarsonZa
Contributor

try |appendcols instead of |append

0 Karma
Get Updates on the Splunk Community!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...