Splunk Search

Adding filed format to dynamic field names

gajananh999
Contributor

Dear All

Hope you are doing good.

I want to add the $ to my data but field name is dynamic so how can i add $ to my data which is coming for dynamic field

like this ex

Product 20-25 30-35 35-40

prod 1 $1,000 $2,000 $3,000

prod 2 $4,000 $5.000 $6.000

If there are actual field like age then i can do it by age= "$"+ age
but here i don't know the how to do for dynamic field

Can anyone please help me on this.

Thanks
Gajanan Hiroji

Tags (1)
1 Solution

aholzer
Motivator

Try this:

chart eval("$"+sum(Total_Covered_Amount)) over Product_Name by Age

View solution in original post

aholzer
Motivator

Try this:

chart eval("$"+sum(Total_Covered_Amount)) over Product_Name by Age

aholzer
Motivator

This should do the trick:

eval("$"+toString(sum(Total_Covered_Amount),"commas"))

0 Karma

gajananh999
Contributor

Its done eval("$"+tostring(sum(Total_Covered_Amount),"commas"))

This will gives you commas also..

0 Karma

gajananh999
Contributor

Ya Thank you .... this works fine for me can you please tell me how to add comma for that value

0 Karma

gajananh999
Contributor

See This is my search :
index="inforce_analytix"|eval Age=2013-Subscriber_Year |bin Age span=5| chart sum(Total_Covered_Amount) over Product_Name by Age | rename Product_Name as "Product Name"

I want get data like as i shown in above comment so the so here field will be like 20-25,25-30,30-35

0 Karma

rgcurry
Contributor

For me, your question is not quite clear. In your example, what is the "dynamic field name"? What makes it dynamic? If what you are asking is the value of those items in your example as "prod 1" and "prod 2" change, how is that represented in your data source? Please provide an exmaple of the data source and perhaps we can find a way to get what you want.

0 Karma

gajananh999
Contributor

Can Anyone reply me on this.

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...