<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to create a sensitive table? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-sensitive-table/m-p/672128#M55027</link>
    <description>&lt;P&gt;You could try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| table _time SumTotalErrors
| appendpipe
    [| stats avg(SumTotalErrors) as AverageBySpan by _time
    | eval Span="1m"]
| appendpipe
    [| bin _time span=2m
    | stats avg(SumTotalErrors) as AverageBySpan by _time
    | eval Span="2m"]
| appendpipe
    [| bin _time span=3m
    | stats avg(SumTotalErrors) as AverageBySpan by _time
    | eval Span="3m"]
| appendpipe
    [| bin _time span=5m
    | stats avg(SumTotalErrors) as AverageBySpan by _time
    | eval Span="5m"]
| appendpipe
    [| bin _time span=10m
    | stats avg(SumTotalErrors) as AverageBySpan by _time
    | eval Span="10m"]
| appendpipe
    [| bin _time span=1h
    | stats avg(SumTotalErrors) as AverageBySpan by _time
    | eval Span="1h"]
| where isnotnull(AverageBySpan)&lt;/LI-CODE&gt;</description>
    <pubDate>Sun, 17 Dec 2023 18:32:46 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2023-12-17T18:32:46Z</dc:date>
    <item>
      <title>How to create a sensitive table?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-sensitive-table/m-p/672120#M55021</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i want to create sensitive table. i want to show how many errors happen in average in each time interval&lt;BR /&gt;&lt;BR /&gt;i wrote the following code and it works ok:&lt;/P&gt;&lt;P&gt;| eval time = strptime(TimeStamp, "%Y-%m-%d %H:%M:%S.%Q")&lt;BR /&gt;| bin span=1d time&lt;BR /&gt;| stats sum(SumTotalErrors) as sumErrors by time&lt;BR /&gt;| eval readable_time = strftime(time, "%Y-%m-%d %H:%M:%S")&lt;/P&gt;&lt;P&gt;| stats avg(sumErrors)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;now, i want:&lt;BR /&gt;1. add generic loop to calculate avg for span of 1m,2m,3m,5n,1h,...&lt;BR /&gt;and present all in a table. i tried to replace&amp;nbsp;1d by parameter but i haven't succeed yet.&lt;BR /&gt;&lt;BR /&gt;2. give option to user to insert his desired span in dashboard and calculate the avg errors for him.&lt;BR /&gt;&lt;BR /&gt;how can i do that?&lt;BR /&gt;&lt;BR /&gt;Thanks ,&lt;BR /&gt;Maayan&lt;/P&gt;</description>
      <pubDate>Sun, 17 Dec 2023 14:59:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-sensitive-table/m-p/672120#M55021</guid>
      <dc:creator>maayan</dc:creator>
      <dc:date>2023-12-17T14:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a sensitive table?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-sensitive-table/m-p/672128#M55027</link>
      <description>&lt;P&gt;You could try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| table _time SumTotalErrors
| appendpipe
    [| stats avg(SumTotalErrors) as AverageBySpan by _time
    | eval Span="1m"]
| appendpipe
    [| bin _time span=2m
    | stats avg(SumTotalErrors) as AverageBySpan by _time
    | eval Span="2m"]
| appendpipe
    [| bin _time span=3m
    | stats avg(SumTotalErrors) as AverageBySpan by _time
    | eval Span="3m"]
| appendpipe
    [| bin _time span=5m
    | stats avg(SumTotalErrors) as AverageBySpan by _time
    | eval Span="5m"]
| appendpipe
    [| bin _time span=10m
    | stats avg(SumTotalErrors) as AverageBySpan by _time
    | eval Span="10m"]
| appendpipe
    [| bin _time span=1h
    | stats avg(SumTotalErrors) as AverageBySpan by _time
    | eval Span="1h"]
| where isnotnull(AverageBySpan)&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 17 Dec 2023 18:32:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-sensitive-table/m-p/672128#M55027</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-12-17T18:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a sensitive table?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-sensitive-table/m-p/672130#M55028</link>
      <description>&lt;P&gt;Nevermind&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;beat me too it!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;There is probably a couple ways of doing this but this seemed to work for me on my local&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;base_search&amp;gt;
| eval
        time=strptime(TimeStamp, "%Y-%m-%d %H:%M:%S.%Q")
    | appendpipe
        [
            | bucket span=1m time
                | stats
                    sum(SumTotalErrors) as sumErrors
                        by time
                | eval
                    bucket_type="1 minute"
            ]
    | appendpipe
        [
            | bucket span=2m time
                | stats
                    sum(SumTotalErrors) as sumErrors
                        by time
                | eval
                    bucket_type="2 minutes"
            ]
    | appendpipe
        [
            | bucket span=3m time
                | stats
                    sum(SumTotalErrors) as sumErrors
                        by time
                | eval
                    bucket_type="3 minutes"
            ]
    | appendpipe
        [
            | bucket span=5m time
                | stats
                    sum(SumTotalErrors) as sumErrors
                        by time
                | eval
                    bucket_type="5 minutes"
            ]
    | appendpipe
        [
            | bucket span=1h time
                | stats
                    sum(SumTotalErrors) as sumErrors
                        by time
                | eval
                    bucket_type="1 hour"
            ]
    | stats
        count as sample_size,
        avg(sumErrors) as avg_sumErrors
            by bucket_type
    | eval
        "Average Error Rate (Human Readable)"=round(avg_sumErrors, 0)." Errors per ".'bucket_type'
    | addinfo
    | eval
        search_time_window_sampled=tostring('info_max_time'-'info_min_time', "duration")
    | fields - info_*_time, info_sid
    | sort 0 +sample_size&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Not quite a loop but I am curious about this so I will keep trying out different things.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Output should look something like this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dtburrows3_0-1702840058491.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/28557iCAF75FED8DD137F8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dtburrows3_0-1702840058491.png" alt="dtburrows3_0-1702840058491.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As for the dashboard, you can set up an input token (dropdown) to allow the user to select a span and use that token on the&amp;nbsp;&lt;BR /&gt;| bucket span=$span$ time&amp;nbsp;&lt;BR /&gt;then do your stats command.&lt;/P&gt;</description>
      <pubDate>Sun, 17 Dec 2023 19:11:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-sensitive-table/m-p/672130#M55028</guid>
      <dc:creator>dtburrows3</dc:creator>
      <dc:date>2023-12-17T19:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a sensitive table?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-sensitive-table/m-p/672152#M55029</link>
      <description>&lt;P&gt;Thanks!! works!&lt;BR /&gt;If you succeed to do that in loop (something like loop for i in (1h,5m,2m,1m...) ) it will be great&amp;nbsp;&lt;BR /&gt;because the query is very long &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Regarding the parameter - yes i can add drop down filter to my dashboard, i wonder if i can give the users option to insert the span number and not to provide them predefined list in the drop down filter&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2023 08:34:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-sensitive-table/m-p/672152#M55029</guid>
      <dc:creator>maayan</dc:creator>
      <dc:date>2023-12-18T08:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a sensitive table?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-sensitive-table/m-p/672153#M55030</link>
      <description>&lt;P&gt;thanks! good solution like always &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2023 08:35:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-sensitive-table/m-p/672153#M55030</guid>
      <dc:creator>maayan</dc:creator>
      <dc:date>2023-12-18T08:35:24Z</dc:date>
    </item>
  </channel>
</rss>

