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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Where Innovation Takes Flight: The Splunk4Aviation Flight Sim Lands at .conf26

If you hear someone at .conf26 shouting "gear down, GEAR DOWN" across the show floor, you have found us.  The ...

Turn Cisco Telemetry Into Action with Cisco Data Fabric, powered by the Splunk ...

The surge in machine data is already hitting enterprise budgets, and the agentic era will only intensify it. ...

Persistent Queue at TcpOut — One of Splunk's Most Practical Features

Splunk introduced persistent queueing at the tcpout layer as one of the most practical resilience features in ...