Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Splunk Search

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- Splunk Answers
- :
- Using Splunk
- :
- Splunk Search
- :
- How to multiply the x-axis values by the y-axis va...

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted
##
How to multiply the x-axis values by the y-axis values and display the result on the y-axis in the chart?

I got a project where I have a csv file with one particular field. Each bar ranges from 200-700 in value. I need to be able to multiply the values in the x-axis by the numbers on the y-axis and put the resultant number on the y-axis.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

nitro345

New Member

09-15-2016
10:38 AM

Highlighted
##
Re: How to multiply the x-axis values by the y-axis values and display the result on the y-axis in the chart?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

sundareshr

Legend

09-15-2016
10:58 AM

Please share some sample data

Highlighted
##
Re: How to multiply the x-axis values by the y-axis values and display the result on the y-axis in the chart?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

nitro345

New Member

09-15-2016
12:36 PM

```
3
10
20
3
20
20
20
3
20
2
10
5
20
5
1
1
20
3
2
1
3
2
2
5
3
20
5
20
3
5
20
1
3
```

Highlighted
##
Re: How to multiply the x-axis values by the y-axis values and display the result on the y-axis in the chart?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

sundareshr

Legend

09-15-2016
12:41 PM

The format doesn't seem right. This appears to be all in one column. Please post it as an image

Highlighted
##
Re: How to multiply the x-axis values by the y-axis values and display the result on the y-axis in the chart?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

ppablo

Community Manager

09-15-2016
12:42 PM

Hi @nitro345

If you're sharing sample data, please be sure to highlight all of it and click the "Code Sample" button in the text editing tools to make sure special characters render properly.

Highlighted
##
Re: How to multiply the x-axis values by the y-axis values and display the result on the y-axis in the chart?

here is the data. i need to chart out the numbers on the x axis and the number of times each value occurs times the value itself. example 20 occurs 10 times y axis will be 20*10

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

nitro345

New Member

09-15-2016
08:53 PM

Highlighted
##
Re: How to multiply the x-axis values by the y-axis values and display the result on the y-axis in the chart?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

somesoni2

SplunkTrust

09-15-2016
02:06 PM

It's really difficult to provide any suggestion without proper sample data. Also, is the data indexed in Splunk OR added as lookup table files (since this is CSV)?

Generally, If you've a search generating two columns X and Y, and if you want to calculate another Value as `X*Y`

to be plotted in y-axis, then we do like this

```
your current search giving field X and Y | eval Z=X*Y | table X Y Z
```

Use chart visualizations like line/column/bar/area chart.

Highlighted
##
Re: How to multiply the x-axis values by the y-axis values and display the result on the y-axis in the chart?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

somesoni2

SplunkTrust

09-15-2016
09:50 PM

Based on your new comment , try this

`Your current search giving data with field X | stats count by X | eval Y=count*X`

Highlighted
##
Re: How to multiply the x-axis values by the y-axis values and display the result on the y-axis in the chart?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

lguinn2

Legend

09-15-2016
03:46 PM

You talk about the X-axis and Y-axis - what do you mean by that?

If you could simply show the Splunk commands that you are using, and possibly a few lines from the Statistics tab (if you have any results to show), I am sure the community could help quickly and easily.

If you don't have anything else, at least run a search and use the `| table`

command to list the fields of interest.

Highlighted
##
Re: How to multiply the x-axis values by the y-axis values and display the result on the y-axis in the chart?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

lguinn2

Legend

09-15-2016
11:21 PM

Based on your description, this should work, although you still didn't give any field names or show your search. For my example, I will assume that the field name in the csv file is "Number." You will have to fill in the search, it is probably something like "source=myfile.csv"

```
yoursearchhere
| chart count by Number
| eval count=count*Number
```

Pick the visualization that you like to show the results: bar chart or column chart will probably work well.