All Apps and Add-ons

What can I put in a vix.input.1.et.format so that hunk searches only look at a limited number of files

alexmc
Explorer

I fear this is a question where I must have missed the answer in the manual

We have a directory tree of data in HDFS looking like

/data/systemname/tablename/2015/02/27/05

so I want to create a virtual index such that Hunk knows that certain directories are associated with certain dates only. (Partition pruning I think)

My understanding is that I need to define my virtual index something like this... Is this right?

vix.input.1.et.regex = /(\d+)/(\d+)/(\d+)/(\d+)
vix.input.1.et.format = YYYYmmddHH
vix.input.1.et.offset = 0
vix.input.1.lt.regex = /(\d+)/(\d+)/(\d+)/(\d+)
vix.input.1.lt.format = YYYYmmddHH
vix.input.1.lt.offset = 3600

(Am I right in thinking that 3600 is the number of seconds in my bucket - one hour)

I really need some examples of using "earliest", "latest" as well as "earliest_time" and "latest_time" in hunk.

Can I do this AND set _time by looking at a UTC field within my data?

Thanks!

1 Solution

hyan_splunk
Splunk Employee
Splunk Employee

The "Customize timestamp format" checkbox on virtual index page is for configuring timestamp and partition pruning by time.

There are examples under each input box in that "Time" section. Here is the setting for your case:

vix.input.1.et.regex=/data/systemname/tablename/(\d+)/(\d+)/(\d+)/(\d+)
vix.input.1.et.format=yyyyMMddHH
vix.input.1.et.offset=0
vix.input.1.lt.regex=/data/systemname/tablename/(\d+)/(\d+)/(\d+)/(\d+)
vix.input.1.lt.format=yyyyMMddHH
vix.input.1.lt.offset=3600

View solution in original post

Ledion_Bitincka
Splunk Employee
Splunk Employee

(Am I right in thinking that 3600 is the number of seconds in my bucket - one hour)
Yes

I really need some examples of using "earliest", "latest" as well as "earliest_time" and "latest_time" in hunk.

Are you asking about how to specify earliest/latest in searches? If so you could simply use the time range picker which is the recommended way, or you can use search time modifiers

0 Karma

hyan_splunk
Splunk Employee
Splunk Employee

The "Customize timestamp format" checkbox on virtual index page is for configuring timestamp and partition pruning by time.

There are examples under each input box in that "Time" section. Here is the setting for your case:

vix.input.1.et.regex=/data/systemname/tablename/(\d+)/(\d+)/(\d+)/(\d+)
vix.input.1.et.format=yyyyMMddHH
vix.input.1.et.offset=0
vix.input.1.lt.regex=/data/systemname/tablename/(\d+)/(\d+)/(\d+)/(\d+)
vix.input.1.lt.format=yyyyMMddHH
vix.input.1.lt.offset=3600

Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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