Reporting

Retrive configured Index name via sendemail.py

ppurokit
Path Finder

Hi All,

I have some set of dashboards created and i have added some search queries as part of the dashboard.

I need to schedule the dashboards for every 1 hr. Hence i make use of the option "Schedule PDF Delivery" and give email ids to which my PDF needs to be delivered.

Since the pdf file name needs to be in a specific format , i modified the sendemail.py to make the pdf file name look something like

CPY Duration Report Type Date_format

Where:
CPY - is the company id

Duration - one of the following values: Daily, Weekly, Monthly

Report_Type: the report name

Date_Format: yyyyMMddhhmmss

As of now i have hardcoded the company id. Example: "splunk"
I will be using the same company name as my index name.

I know indexes.conf has all the index names, but i cant reply on it since i may have multiple indexes.conf for different apps installed.

"/opt/splunk/var/lib/splunk" folder has all the indexes configured.

Is there any piece of code or a unique property file or anything programmatic way in which i will be able to get the configured indexes and use it in the sendemail.py.

0 Karma

yannK
Splunk Employee
Splunk Employee

How do you know which index is related to which scheduled dashboard ?

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

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...