Activity Feed
- Got Karma for Re: How to Horizontally align the radio button in Splunk dashboard. 09-07-2022 12:47 AM
- Posted Re: How to Horizontally align the radio button in Splunk dashboard on Dashboards & Visualizations. 02-24-2020 01:00 PM
- Posted Waterfall Custom Visualization App and Trellised data on All Apps and Add-ons. 10-13-2019 03:04 PM
- Tagged Waterfall Custom Visualization App and Trellised data on All Apps and Add-ons. 10-13-2019 03:04 PM
- Posted Re: Convert string to command, for dynamic union search on Splunk Search. 09-16-2019 09:17 PM
- Posted Convert string to command, for dynamic union search on Splunk Search. 09-15-2019 08:26 PM
- Tagged Convert string to command, for dynamic union search on Splunk Search. 09-15-2019 08:26 PM
- Tagged Convert string to command, for dynamic union search on Splunk Search. 09-15-2019 08:26 PM
- Tagged Convert string to command, for dynamic union search on Splunk Search. 09-15-2019 08:26 PM
- Tagged Convert string to command, for dynamic union search on Splunk Search. 09-15-2019 08:26 PM
- Posted Re: How to Horizontally align the radio button in Splunk dashboard on Dashboards & Visualizations. 08-08-2019 06:37 PM
- Posted Re: How to display the last results from a scheduled saved search on a dashboard, not the job currently running? on Dashboards & Visualizations. 03-21-2019 07:54 PM
Topics I've Started
Subject | Karma | Author | Latest Post |
---|---|---|---|
0 | |||
0 |
02-24-2020
01:00 PM
I've just been inserting a <html><br/></html> between horizontal rows.
... View more
10-13-2019
03:04 PM
I'm wanting to produce a variable, large number of Waterfall charts all with the same format and source data. Is it possible to do this in a Trellis with a Waterfall chart using this app? If not, what would be needed to improve it to do so, or is there an alternate app that can do it?
Example data generated as follows:
| makeresults
| eval
2019-01="1,2,3",
2019-02="1,2,3",
2019-03="2,2,2",
2019-04="-1,0,1"
| fields - _time
| transpose 0 column_name="month"
| rex field="row 1" "(?<dat1>.+),(?<dat2>.+),(?<dat3>.+)"
| fields month dat*
| addcoltotals labelfield="month" label="Total"
Adding a | fields month dat1 shows a single valid Waterfall chart, but I'd ideally like to see a way of having the above data create 3 Trellised Waterfall charts (or in the case of my dataset, a trellissed chart per dat* column). In order to get this working with this app I'd have to create a panel per chart with visibility triggers on each, which isn't as desirable.
... View more
09-16-2019
09:17 PM
While this does function, it causes the search to be subject to the subsearch limit, e.g.
info : [map]: [map]: Search Processor: Subsearch produced 76673 results, truncating to maxout 10000.
This doesn't occur when run as the raw command. The only way around this (that I know of) would be global to my org, so not an option. (The above number is the search results at the moment for 1 day's worth of data)
Thanks for the suggestion though, it was worth trying. I do find it interesting that it works only when you wrap the map inside another map though.
... View more
09-15-2019
08:26 PM
TL;DR - Is there a way (without custom scripts or commands) to run a command from a string in the format of a union that contains a dynamic number of subsearches?
I have quite a few heavy dashboards that get hit by many users, quite frequently. In order to save both processing power and user time, I've been caching search results (such as in a loadjob or outputlookup ) and stitching them together dynamically. These dashboards all use a single savedsearch , and an instance of the search will cache data hourly, usually saving a day's worth of back-data. The dashboards then take the saved data and combine it with a call of the same search from the start of the hour until now(), and it's significantly faster.
I'm trying to create a macro that can do this intelligently so I don't have to re-build it per dashboard/savedsearch etc. I've created a search that can generate a string that, when used as a command, searches fine. However, I've been unable to find a way to get it to actually run - as far as I or anyone in my team can tell, anything that's a string can only be run as a search , which is insufficient for my needs as it ends up literally searching for a string talking about unions.
The example string that's being generated by the query below reads nicely as: (though NB, the output string could just as easily be a single line with no union or sort , or a union of two subsearches)
| union
[ | savedsearch my_savedsearch earliest=1568343703.000000 latest=1568462400.000000 ]
[ | inputlookup mycsv.csv ]
[ | savedsearch my_savedsearch earliest=1568602800.000000 latest=1568602843.000000 ]
| sort - _time
The generating query has an initial eval statement that I intended to use when moving it into a macro, which is stubbing the various args. Modifying these will dynamically change the number of subsearches/times (as the user might be requesting a time period relative to the cached data that is before, after, during, or some combination of each). Variants of this have been attempted using things like append , appendpipe , multisearch , but all seem to fail due to various reasons except the above (circular dependencies, streaming commands etc). The string generated, when run against a valid dataset, works. When the command is passed as the search itself using subsearches/ return etc all fail - as far as we can tell, it's trying to run it as a search , or otherwise is unable to handle it.
Generating query: (replace contents in the initial eval for different dataset examples)
| makeresults
| eval
timerange_string="| inputlookup mycsv.csv",
timerange_earliest=relative_time(now(), "-1d@d"),
timerange_latest=relative_time(now(), "@h"),
time_string="| savedsearch my_savedsearch",
time_earliest=relative_time(now(), "-3d"),
time_latest=relative_time(now(), "-1m")
| eval
earliest_period=case(
time_earliest < timerange_earliest,-1,
(timerange_earliest <= time_earliest AND time_earliest <= timerange_latest),0,
timerange_latest < time_earliest,1,
true()=true(),"null"
),
latest_period=case(
time_latest < timerange_earliest,-1,
(timerange_earliest <= time_latest AND time_latest <= timerange_latest),0,
timerange_latest < time_latest,1,
true()=true(),"null"
)
| fields - _time
| eval
union_string=if(earliest_period!=latest_period,"| union [ ",""),
search=
if(earliest_period=0 OR latest_period=0,"| search","")
.if(earliest_period=0," earliest=".time_earliest,"")
.if(latest_period=0," latest=".time_latest,""),
inputlookup=timerange_string." ".search,
inputlookup_string=if(earliest_period*latest_period<1,inputlookup,""),
ss1=time_string." earliest=".time_earliest." latest=".if(latest_period=-1,time_latest,timerange_earliest),
ss1_string=if(earliest_period=-1,ss1,""),
ss2=time_string." earliest=".if(earliest_period=1,time_earliest,timerange_latest)." latest=".time_latest,
ss2_string=if(latest_period=1,ss2,""),
sort_string=if(earliest_period!=latest_period," ] | sort - _time","")
| eval search=union_string.ss1_string.if(earliest_period=-1 AND latest_period!=-1," ] [ ","").inputlookup_string.if(latest_period=1 AND earliest_period!=1," ] [ ","").ss2_string.sort_string
| fields search
There are some similar questions (don't have enough karma to post links), but none directly tackle this use case, as map doesn't seem to be a viable solution here (triggers circular dependencies) and the general advice given with return doesn't work (as mentioned above).
Is there an obvious option I'm missing here? The next step I'd be looking at would be writing a custom command, which is less portable than a macro. I'll be working on that at some point, but if there's a way to do this with a macro using a basic Splunk query, it'd be my preference.
... View more
08-08-2019
06:37 PM
1 Karma
vnravikumar's answer was good for the alignment of the radio buttons, but didn't make the text and radio button aligned, leading what looked like the text being aligned vertical-top and the radio button vertical-bottom. Now that Splunk has large components of the CSS in flexboxes, the following CSS works well in my Splunk instance (7.1.4, but assuming it'll work in more recent versions too):
#exampleRadioId1 div {
flex-flow: row wrap;
}
#exampleRadioId2 div {
flex-flow: row wrap;
}
.splunk-radiogroup label {
padding-right: 5px;
}
.splunk-radiogroup is still an inline-block (inside the flex-box) and so needs to have a single change made to it to have the padding between buttons the same as the padding between an individual radio button and the text aligned to it - it can be increased to 10px or more if you desire.
... View more
03-21-2019
07:54 PM
The docs linked say that artifact_offset defaults to 0, which says to me that this shouldn't change any behaviour. Is this a change in behaviour between this post and now, or is the documentation would and the default state differs to an explicit artifact_offset=0 ?
... View more