Splunk Search

How to: Splunk without any formatting?

bkeif
Path Finder

Hello,

So I have written a very simple Django app that displays a basic HTML and CSS webpage. The only reference to splunk is "{% load splunkmvc %}" at the top of my home.html. What I want is the ability to perform searches on this page and display the results in plain text only, no splunk formatting or styling at all.

Right now If I add a query in the {% block managers%} section and reference that query in the HTML I get no results. However, If I add {% extends "splunkdj:base_with_basic_styles.html" %} then the query will work and return results...only they are formated by splunk. Rather than just giving me the single value I want it generates several div's nested in each other and imposes several CSS classes on them from some place I've never referenced producing a large box on my webpage with bold text displaying the result.

What are the bare minimum requirements to perform a splunk search? (ie. a couple JavaScript files I could include in the {% block js %} or something of the sort)

Is this even possible?

Thanks

Here is my search:

{% block managers%}
{% searchmanager
id="search_total"
search="| metadata type=sourcetypes index=* | stats sum(totalCount)"
%}
{% endblock managers%}

Here is how I reference it within the body of the HTML:

{% single id="total" managerid="search_total" %} total events.

This is what I have to add to the HTML to get results (also produces undesired formatting):

{% extends "splunkdj:base_with_basic_styles.html" %}

0 Karma
1 Solution

jeffland
SplunkTrust
SplunkTrust

You can do the entire search manager creation and result handling with Javascript. You should check out this overview and from there do the tutorials on the right to see how it works.

View solution in original post

jeffland
SplunkTrust
SplunkTrust

You can do the entire search manager creation and result handling with Javascript. You should check out this overview and from there do the tutorials on the right to see how it works.

bkeif
Path Finder

Thank you much for your reply. I will look into this as work allows.

Update: Much appreciated! This appears to be exactly what I was looking for. I'm not sure how I missed it during my documentation perusing.

0 Karma
Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...