Splunk Search

splunk app for NLP : trying to get average sentiment by index

denymw
Explorer

Hi, I am trying to get a visualization to show the average sentiment of a search term by the index.

index=* foo | table text| vader textfield=text| stats avg(sentiment) as sentiment

as expected gives me a decimal return labelled sentiment

index=* foo | table text| vader textfield=text| stats avg(sentiment)

returns the same decimal unlabeled

but I can not get
index=* foo | table text| vader textfield=text| stats avg(sentiment) by index

to return a sentiment decimal based on the results from the different indexes, I am obviously going wrong somewhere but I can not work out where, any help is greatly appreciated.

Tags (1)
0 Karma
1 Solution

renjith_nair
Legend

@denymw,

In your search, you are using | table text which restricts the fields to only text. If you need index also part of your stats , add index also to the table command or remove the table command completely.

Try

index=* foo | vader textfield=text| stats avg(sentiment) as sentiment by index
---
What goes around comes around. If it helps, hit it with Karma 🙂

View solution in original post

renjith_nair
Legend

@denymw,

In your search, you are using | table text which restricts the fields to only text. If you need index also part of your stats , add index also to the table command or remove the table command completely.

Try

index=* foo | vader textfield=text| stats avg(sentiment) as sentiment by index
---
What goes around comes around. If it helps, hit it with Karma 🙂

denymw
Explorer

thank you so much, I didn't even see I had copied that in.

0 Karma
Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...