Splunk Search

Ingesting different data types into one index

JimBrent
Explorer

Hi,

I am being asked if we can ingest two different data formats into one index. Specifically the primary data type is Key Value pairs however from one source the data format is JSON.

A quick search of this site yielded: https://answers.splunk.com/answers/357887/is-there-a-way-to-configure-splunk-to-parse-a-sour.html

So it seems as thought it is possible.

A second related question would be - If that is possible then it this a bad idea... My experience has been that every time I have introduced strange one-offs into any technological solution the super-cool specialized permutation becomes more hassle than it is worth...

0 Karma
1 Solution

niketn
Legend

Consider index as your Database and sourcetypes as your tables (schema on the fly) within Database (index). Several types of schemas (sourcetypes) can be defined within your Database (index).

An advantage of such sourcetypes (provided you have followed proper naming conventions would be during event correlation where you can use AND/OR/NOT, =, != and also wildcard (*) within you base search involving your sourcetypes. Adding index and sourcetype and filtering required records upfront in your base query will boost your Splunk search performance.

If you create only one index per schema, you will end up creating too many indexes. However, only advantage is that data from similar sources having same sourcetypes can be corrected/deleted/re-indexed within their own separate indexes, without impacting other sourcetypes.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

0 Karma

niketn
Legend

Consider index as your Database and sourcetypes as your tables (schema on the fly) within Database (index). Several types of schemas (sourcetypes) can be defined within your Database (index).

An advantage of such sourcetypes (provided you have followed proper naming conventions would be during event correlation where you can use AND/OR/NOT, =, != and also wildcard (*) within you base search involving your sourcetypes. Adding index and sourcetype and filtering required records upfront in your base query will boost your Splunk search performance.

If you create only one index per schema, you will end up creating too many indexes. However, only advantage is that data from similar sources having same sourcetypes can be corrected/deleted/re-indexed within their own separate indexes, without impacting other sourcetypes.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

JimBrent
Explorer

Ok this really makes sense... how the question is wether or not more than one source type will meet the needs of the customer... I will check with them and ask a follow on question if required.

Thank you.

0 Karma

ddrillic
Ultra Champion

You see, a Splunk index doesn't enforce any schema at any point, so you can have completely different types of data within one index, hopefully with different sourcetypes.

0 Karma

JimBrent
Explorer

Of course very logical... thank you for the quick answer...

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

An index can get data from any number of sourcetypes. It's not a strange one-off at all.

0 Karma

JimBrent
Explorer

Also very logical and helpful... thank you for the quick answer...

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