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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

Splunk is officially part of Cisco

Revolutionizing how our customers build resilience across their entire digital footprint.   Splunk ...

Splunk APM & RUM | Planned Maintenance March 26 - March 28, 2024

There will be planned maintenance for Splunk APM and RUM between March 26, 2024 and March 28, 2024 as ...