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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...