Splunk Search

What's the best way to compare data in two different environments with outputlookup?

AydinCan
Loves-to-Learn Lots

Hallo splunk users,

What is the best way to compare the same data in two different environments (producktion and lab) with outputlookup?

thanks Aydin

0 Karma

gcusello
Legend

Hi
why do you speak about "outputlookup"?

At first you can ingest logs from both your environments and put them into one or two indexes:

  • probably you're not interested to maintain lab logs for the same time of production logs, so it could be better to put logs into two different indexes (e.g. my_prod and my_lab)
  • then you can configure the same ingestion (sourcetypes) in bothe the environments so you can compare fields
  • so you can put in the same search both the indexes and run something like this:

    index=my_prod OR index=my_lab
    | chart count over field1 BY index
    in this way you can compare the number of occurrances of field1 in both the environments.

If instead you want to compare values you can run something like this:

index=my_prod OR index=mt_lab
| eval field1_prod=(if index="my_prod", field1,""), field1_lab=(if index="my_lab", field1,"")
| table _time field1_prod field1_lab

in this way you can compare field1 values in both the environments.
Following the above methods you can performa other comparations.

Bye.
Giuseppe

0 Karma

AydinCan
Loves-to-Learn Lots

Thanks for your answer. I need to keep those both environments separate. Thats why i wanted to make a lookup at one to compare it to the other environment. I'am new with Splunk so don't know how to do check if in "old" environment has the same data as in the "new" environment.

Thanks

0 Karma

gcusello
Legend

Hi AydinCan,
if you're satisfied by this answer, please accept or upvote it.
Bye.
Giuseppe

0 Karma

Can you add some sample data from Prod and Lab (mask or anonymize any sensitive information before posting)?

What is the type of data and also explain what are the type of differences you are trying to capture? Please add more details for community to assist you better.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

Happy CX Day to our Community Superheroes!

Happy 10th Birthday CX Day!What is CX Day? It’s a global celebration recognizing innovation and success in the ...

Check out This Month’s Brand new Splunk Lantern Articles

Splunk Lantern is a customer success center providing advice from Splunk experts on valuable data insights, ...

Routing Data to Different Splunk Indexes in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. The OpenTelemetry project is the second largest ...