Splunk Search

Make a Chart by 2 fields

lnn2204
Path Finder

Hi guys, I want make a chart with the value below. With IP is the separated line, and connections is the value, apache_method is the X-Axis

apache_method IP  Connect_time

GET
10.10.107.10
10.10.107.14
29
13222
HEAD10.10.107.141
OPTIONS
10.10.107.14
::1
12
15
PMFK10.10.107.141
POST
10.10.107.12
10.10.107.14
5
38636
PROPFIND10.10.107.143
Labels (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Assuming you have access to the individual events and don't need to unpack the table, and also assuming you want the count of method events by ip not the sum of the connection times, try something like this:

| gentimes start=-1000
| eval ip="10.10.107.".tostring(random() % 5 + 10)
| eval method=mvindex(split("GET,HEAD,OPTIONS,PMFK,POST,PROPFIND",","),(random() % 6))
| eval connect_time=round(random() % 1000,0)
``` The above generates some dummy data ```

``` Count events by ip and method ```
| stats count by ip method
``` Organise data so method is x-axis, line for each ip and count is y-axis ```
| xyseries method ip count

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Assuming you have access to the individual events and don't need to unpack the table, and also assuming you want the count of method events by ip not the sum of the connection times, try something like this:

| gentimes start=-1000
| eval ip="10.10.107.".tostring(random() % 5 + 10)
| eval method=mvindex(split("GET,HEAD,OPTIONS,PMFK,POST,PROPFIND",","),(random() % 6))
| eval connect_time=round(random() % 1000,0)
``` The above generates some dummy data ```

``` Count events by ip and method ```
| stats count by ip method
``` Organise data so method is x-axis, line for each ip and count is y-axis ```
| xyseries method ip count
0 Karma

lnn2204
Path Finder

Thanks for your helping. But I just solved the problem, and I found that I can't use this search in real-time. I tried your solution, it's still not work too.

lnn2204_0-1618396651839.png

 

0 Karma

lnn2204
Path Finder

lnn2204_0-1618366744561.png

This my chart now, how to make the line is separated IP address

0 Karma
Get Updates on the Splunk Community!

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...