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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...