Activity Feed
- Got Karma for Re: Why am I unable to multiply two fields fields with my current search syntax?. 06-11-2024 10:44 AM
- Got Karma for Re: Append Non Matching Results to Lookup Table. 04-24-2022 05:14 PM
- Got Karma for Re: Stats Values and Count. 11-03-2021 12:34 PM
- Karma Re: Stats Count Eval If for cvssravan. 06-05-2020 12:50 AM
- Karma Re: Stats Count Eval If for renjith_nair. 06-05-2020 12:50 AM
- Karma Re: Subtotals with Sum for woodcock. 06-05-2020 12:50 AM
- Karma Re: Can you help me incorporate my search into a summary Index? for ashajambagi. 06-05-2020 12:50 AM
- Got Karma for Use Timepicker Token With Field. 06-05-2020 12:50 AM
- Karma Re: Stats values Into timechart -- I can't get timechart to work for cmerriman. 06-05-2020 12:49 AM
- Karma Re: Replace First Two Digits for gcusello. 06-05-2020 12:49 AM
- Got Karma for How to display zero count in a stats table?. 06-05-2020 12:49 AM
- Got Karma for Transpose Multiple Column Headers. 06-05-2020 12:49 AM
- Got Karma for Re: Hide/Display Panels Using Multiselect. 06-05-2020 12:49 AM
- Got Karma for Hide/Display Panels Using Multiselect. 06-05-2020 12:49 AM
- Karma Re: How to Update a Lookup Table for DMohn. 06-05-2020 12:48 AM
- Karma Re: Different Results From Similar Queries for somesoni2. 06-05-2020 12:48 AM
- Karma Re: What configuration file contains app version numbers so I can propagate version numbers from GitHub to Splunk? for javiergn. 06-05-2020 12:48 AM
- Karma Re: Why am I getting no results from my saved search with append when I extend the range on the dashboard time picker? for woodcock. 06-05-2020 12:48 AM
- Karma Re: Extract Searches Performed for somesoni2. 06-05-2020 12:48 AM
- Karma Re: Eval If Statement for dwaddle. 06-05-2020 12:48 AM
Topics I've Started
Subject | Karma | Author | Latest Post |
---|---|---|---|
0 | |||
0 | |||
0 | |||
0 | |||
0 | |||
0 | |||
0 | |||
0 | |||
0 | |||
0 |
03-02-2019
10:15 AM
Hi @richgalloway. Thank you for posting this.
As you would expect the table has the 3 columns, but unfortunately the "header" column is blank.
Many thanks and kind regards
Chris
... View more
03-01-2019
06:23 AM
Hi.
Running them side by side, the results are table layout are the same from what I can see.
Here is the layout I'd like if possible please:
RequestID Time Multiple columns where fields start with clientHeaders.test
1234 15/05 Count for each column heading
These are examples of the fieldnames:
clientHeaders.test-client-device-id
clientHeaders.test-client-device-ip
clientHeaders.test-test-scenario
But this list is not exhaustive. It will increase but I would like to 'futureproof' the query so I don't need to constantly update when new fields appear with this naming convention, if possible please.
Many thanks and regards
Chris
... View more
03-01-2019
05:36 AM
Hi @richgalloway. Thank you. I thought that was the case.
Unfortunately it only gives me two columns, 1 called header and the the other count(header), in addition to the time and RequestID.
Many thanks and regards
Chris
... View more
03-01-2019
05:28 AM
Hi @tiagofbmm . Thank you for coming back to me with this.
So some examples of the fields are:
clientHeaders.test-client-colour-depth
clientHeaders.test-client-device-id
clientHeaders.test-client-device-ip
clientHeaders.test-test-scenario
But this list is not exhaustive. It will increase but I would like to 'futureproof' the query so I don't need to constantly update when new fields appear with this naming convention, if possible please.
And for the columns, I'd like if possible to be as follows:
RequestID Time Multiple columns where fields start with clientHeaders.test
1234 15/05 Count for each column heading
I hope this makes sense and once again many thanks.
Kind Regards
Chris
... View more
02-28-2019
11:19 PM
Hi @richgalloway.
Thank you for coming back to me with this. May I just check, in this
[eval header=header+test<<MATCHSTR>>] .
The test element. Where is this taken from?
Many thanks and kind regards
Chris
... View more
02-28-2019
06:03 AM
Hi @richgalloway, thank you for coming back to me with this.
I've managed to put a solution together as follows:
| multisearch
[ search `gateway_wmf(ClientRequest)` path=*test*]
[ search `wso2_wmf(RequestCompleted)` "request.detail.apiContext"=*test]
| eval RequestID=coalesce('request.tags.X-Request-ID','requestID')
| eval header=""
| foreach clientHeaders.test* [eval header='<<FIELD>>']
| bucket span=10s _time
| stats count(header) by RequestID _time header
The problem I have, and this is through lack of knowledge, I didn't realise that it extracted the field value rather than the fieldname.
Could you tell me please is there a way to count the field headers rather than the values?
Many thanks and kind regards
Chris
... View more
02-28-2019
03:36 AM
Hi @sdchakraborty . Thank you for coming back to me.
I'm sorry to ask particularly as you've been so helpful but which element do I use in my dashboard. I'm having a little difficulty in following the data/field journey?
Many thanks and kind regards
Chris
... View more
02-28-2019
01:18 AM
Hi @tiagofbmm . Thank you for taking the time to come back to me with this.
The query I posted is correct except for the .test. It is something mores restricted but the process should be the same and so I have changed this when I use it in my system.
There are up to 15 'client,header' fields and may be more in the future so I thought, perhaps wrongly that by using 'foreach clientHeaders.test*' would future proof.
Many thanks and kind regards
Chris
... View more
02-27-2019
11:48 PM
Hi @sdchakraborty . Thank you for coming back to me with this.
No it's the other way around, so when the user selects the 'timepicker' time range it extracts the correct data using the Epoch time fields.
Many thanks and kind regards
Chris
... View more
02-27-2019
11:15 PM
Hi, I wonder whether someone can help me please.
I've put together the query below using the foreach command, which, although I've read a lot of posts, I've not really used, or if truth be known understood a great deal.
| multisearch
[ search `gateway_wmf(ClientRequest)` path=*vat*]
[ search `wso2_wmf(RequestCompleted)` "request.detail.apiContext"=*test]
| eval RequestID=coalesce('request.tags.X-Request-ID','requestID')
| dedup eventId
| rename request.detail.applicationProductionClientId as ClientID response.detail.statusCode AS statusCode
| foreach clientHeaders.test* [eval header='<<FIELD>>']
| stats count(header) by RequestID
The query runs, but there is no new field called "header" created and hence I don't receive my stats count at the end of the query.
Could someone perhaps have a look a this please and offer some guidance on where I've gone wrong and a brief explanation of the 'foreach' command.
Many thanks and kind regards
Chris
... View more
02-27-2019
11:14 PM
Hi, I wonder whether someone can help me please.
I've put together the query below using the foreach command, which, although I've read a lot of posts, I've not really used, or if truth be known understood a great deal.
| multisearch
[ search `gateway_wmf(ClientRequest)` path=*vat*]
[ search `wso2_wmf(RequestCompleted)` "request.detail.apiContext"=*test]
| eval RequestID=coalesce('request.tags.X-Request-ID','requestID')
| dedup eventId
| rename request.detail.applicationProductionClientId as ClientID response.detail.statusCode AS statusCode
| foreach clientHeaders.test* [eval header='<<FIELD>>']
| stats count(header) by RequestID
The query runs, but there is no new field called "header" created and hence I don't receive my stats count at the end of the query.
Could someone perhaps have a look a this please and offer some guidance on where I've gone wrong and a brief explanation of the 'foreach' command.
Many thanks and kind regards
Chris
... View more
02-27-2019
10:47 PM
1 Karma
Hi,
I wonder whether someone could help me please.
I'm using a query which interrogates a Summary Index containing two fields called Epoch_STime and Epoch_ETime.
I'm then using the query in a dashboard panel which includes a timepicker called "timerange".
What I'm trying to do is set the earliest time from the timepicker to the Epoch_STime and the latest date of the timepicker to Epoch_ETime.
I've tried earliest=$Epoch_Stime$ and the same for the latest time , but I can't get this to work.
Could someone possibly look at this please and let me know where I've gone wrong?
Many thanks and kind regards
Chris
... View more
02-26-2019
12:09 AM
Hi, I found the solution which is:
sum(eval(if(signout="1", "1", "")))
Many thanks to all your suggestions and help.
Kind Regards
... View more
02-25-2019
11:24 PM
Hi @cvssravan.
Thank you for this. I'll have to look to see if this is possible.
Kind Regards
Chris
... View more
02-25-2019
11:09 PM
Hi @noy72 . Thank you for coming back to me. This is something that I may have to think about. Although not ideal, it would at least have a greater difference visually from a number.
Many thanks and kind regards
Chris
... View more
02-25-2019
10:58 PM
Hi @somesoni2. Thank you for coming back to me with this.
The current output is a zero, but I'd like the value to be blank please.
Many thanks and kind regards
Chris
... View more
02-25-2019
07:23 AM
Hi @renjith.nair.
Thank you for coming back to me with this.
Unfortunately I'd like the field to be blank if it zero rather than having a value in it. When I have tried the code you kindly provided, even putting a text value in, the field still returns a zero.
Many thanks and kind regards
Chris
... View more
02-25-2019
02:52 AM
Hi, I wonder whether someone can help me please.
I'm using number the following as part of a query to extract data from a summary Index
| stats count(eval(repayments_submit="1")) as repyaments_submit count(eval(forms_ChB="1")) as forms_ChB
The code works find, except that where the null value is null, it's shown as a zero and I'd like it to be blank.
I've tried count(eval(if(signout="1", ""))) , but I receive the following error:
Error in 'stats' command: The eval
expression for dynamic field
'eval(if(signout="1", ""))' is
invalid. Error='The arguments to the
'if' function are invalid.'
Could someone look at this please and let me know where I've gone wrong?
Many thanks and kind regards
Chris
... View more
02-22-2019
02:10 AM
Hi. Because your comment is a comment and not an answer I can't accept it.
If you want to change it I'd be more than happy to accept.
Regards
Chris
... View more
02-22-2019
01:56 AM
Hi @lakshman239. Many thanks for your help.
Kindest Regards
Chris
... View more
02-22-2019
01:43 AM
Hi @lakshman239 . Thank you for coming back to me with this.
My use case is the former. i.e. improve performance and then query the dashboard.
Yes I'd looked at the guidance, but my confusion was around the transforming commands. I'd read some documentation/posts which suggested to use them in the query populating the SI with data, whereas as some said not to.
Many thanks and kind regards
Chris
... View more
02-22-2019
12:36 AM
Hi,
I wonder whether someone may be able to help me please.
I'm using the following query:
(`company_wmf(Login)` authentication=Success) OR (`login-frontend_wmf(Login)` authentication=Success) OR | eval "X-sessionId"=coalesce('tags.X-Session-ID', sessionId) | eval time=strftime(earliest_time, "%d/%m/%Y %H:%M:%S") | eval endtime=strftime(_time, "%d/%m/%Y %H:%M:%S") | eval PTA=if('tags.path'="/account",1,"") | stats earliest(time) as time latest(endtime) as endtime values(test) as test by X-sessionId | search login=PTA login=G test!=""
I'm now wanting to incorporate this into extracting the data into a summary Index.
I've read a lot of documentation and posts, which do seem to contradict each other, so could someone tell me please, would I need to change the query so I can then use the stats portion of the query in a dashboard panel, but pulling the data from the SI?
Many thanks and kind regards
Chris
... View more
02-21-2019
01:48 AM
Hi @woodcock.
I've been working on this and have got this to work by tweaking the final few lines of the code to:
| eval newtime = newtime . " Total"
| streamstats dc(newtime) AS _serial
| multireport
[ rename newtime AS _newtime ]
[ stats sum(*) AS * first(_serial) AS _serial BY newtime
| rename newtime AS _newtime
| eval ClientID = _newtime ]
| sort 0 BY _serial
| fields - newtime
Many thanks for all your help.
Kind Regards
Chris
... View more
02-20-2019
11:11 PM
Hi @woodcock.
Thank you for coming back to me with this. So some success. The table is now visible with all the data shown which is great so thank you.
But, unfortunately there is an issue with the subtotals.
For example, if I run between 31 January and 01 February 2019 here are 10 rows of data then a February subtotal row which is show an incorrect subtotal amount.
There is then say another 10 rows then a January subtotal row again with an incorrect across all columns.
There is then another list of 10 rows without a subtotal row, so it's almost as if it's not grouping the data together properly by the newtime field.
Kindest regards
Chris
... View more
02-20-2019
06:38 AM
Hi @woodcock.
Thank you for coming back to me with this.
Your dummy data and solution work great, but when I amend to include the 'real' field names except for _serial and there is no stats table produced.
For clarity I'm copying my original code snippet up to and inc. | eval newtime=strftime(_time,"%B")
I am then adding your solution to the end. Is this correct please?
Many thanks and regards
Chris
... View more