Dashboards & Visualizations

How do you move fields from one event to another?

pc1234
Explorer

i have events that contain the following.

host sourcetype value1 value2
100 log-c .60
100 log-d .75
100 log-retention-c 1
100 log-retention-d 2
100 cpuload .4

i want to combine the events to the following:

host sourcetype value1 value2
100 log-c .60 1
100 log-d .75 2
100 cpuload .4

The only source type that requires this are those beginning with log. I need value1 or value2 in the same event to calculate a status based on the values.

Note: Sorted by source type, there are no intervening source types between log% and log-retention%.

Any assistance is appreciated.

Best Regards,

Tags (1)
0 Karma

HiroshiSatoh
Champion

I would like you to explain the situation more concretely

As a general story…
The way to combine the fields of another event into the event is below.

(Efficient method)
sourcetype=sourcetype_a OR sourcetype=sourcetype_b  | stats latest(*) AS * BY your_key

(Easy way)
sourcetype=sourcetype_a | join type=inner your_key
[search sourcetype=sourcetype_b  | dedup your_key| table your_key,  fields_1, ields_2,fields_other]
0 Karma
Get Updates on the Splunk Community!

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!

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

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...