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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...