All Apps and Add-ons

How to append the only common events from index B which are already available in INDEX A?

manikanthkoti
Loves-to-Learn Everything

Hi Everyone

I have two Indexes (IndexA and IndexB)in both i have some common events. I need to append only the common events from Index B

to the IndexA Data?

Syntax Like This?

index=indexA |append [search index=indexB |Here write filter condition]

Please help me out this?

Labels (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @manikanthkoti,
your approach can work but there's le limit of 50,000 results in the subsearch and probably your search is very slow.
You can also use join command but I don't like because it's very slow.

You could also try something like this:

index=indexA OR index=indexB
| stats values(field1) AS field1 values(field2) AS field2 dc(index) AS dc_index BY common_field1 common_field2
| where dc_index=2

In this example common_field1 and common_field2 are the common fields used to group results and field1 and field2 are some fields that you need to have in your results.
In this way you haven't subsearchs so no limits in results and this search is faster than the others two.

Ciao.
Giuseppe

0 Karma

to4kawa
Ultra Champion

use join instead of append

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...