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
SplunkTrust
SplunkTrust

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
SplunkTrust
SplunkTrust

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

0 Karma

niketn
Legend

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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...