snipt

Ctrl+h for KB shortcuts

PHP

api key generator

1
2
3
$key = implode('-', str_split(substr(strtolower(md5(microtime().rand(1000, 9999))), 0, 30), 6));

// bd9772-7ee404-56be09-848cdd-061e62
https://snipt.net/embed/e9754b12af7212f4ed4aafd9f612caf7/
/raw/e9754b12af7212f4ed4aafd9f612caf7/
e9754b12af7212f4ed4aafd9f612caf7
php
PHP
4
2019-08-21T22:29:30
True
False
False
Aug 15, 2019 at 04:04 PM
/api/public/snipt/353468/
api-key-generator
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="x">$key = implode(&#39;-&#39;, str_split(substr(strtolower(md5(microtime().rand(1000, 9999))), 0, 30), 6));</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="x">// bd9772-7ee404-56be09-848cdd-061e62</span> </span></pre></div> </td></tr></table>
key

Text only

Hostname S!

1
2
3
4
5
6
7
|tstats count by host,index,source,sourcetype 
|search host=$device_Name$ 
|join host 
		[| metadata type=hosts
			| fields host, recentTime |search host=$device_Name$
			| eval EventLastReceived=strftime(recentTime, "%m-%d-%Y %H:%M:%S")
		|fields - recentTime]
https://snipt.net/embed/d77540f68c06416f362b55f8345946a2/
/raw/d77540f68c06416f362b55f8345946a2/
d77540f68c06416f362b55f8345946a2
text
Text only
7
2019-08-14T10:18:33
True
False
True
Aug 14, 2019 at 10:18 AM
/api/public/snipt/353441/
hostname-s
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>|tstats count by host,index,source,sourcetype </span><span id="L-2"><a name="L-2"></a>|search host=$device_Name$ </span><span id="L-3"><a name="L-3"></a>|join host </span><span id="L-4"><a name="L-4"></a> [| metadata type=hosts </span><span id="L-5"><a name="L-5"></a> | fields host, recentTime |search host=$device_Name$ </span><span id="L-6"><a name="L-6"></a> | eval EventLastReceived=strftime(recentTime, &quot;%m-%d-%Y %H:%M:%S&quot;) </span><span id="L-7"><a name="L-7"></a> |fields - recentTime] </span></pre></div> </td></tr></table>
https://snipt.net/embed/a85e200b423ecce2940270ded524bc35/
/raw/a85e200b423ecce2940270ded524bc35/
a85e200b423ecce2940270ded524bc35
text
Text only
1
2019-08-21T22:31:14
True
False
False
Aug 01, 2019 at 09:59 AM
/api/public/snipt/295032/
writing-to-ud-table-from-customization
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a> </span></pre></div> </td></tr></table>

Text only

My list

[]
https://snipt.net/embed/cd7df989882a5b773b2c3c6991804048/
/raw/cd7df989882a5b773b2c3c6991804048/
cd7df989882a5b773b2c3c6991804048
text
Text only
1
2019-08-21T22:31:31
True
False
False
/api/public/snipt/290585/
my-list-9cc07ed6
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>[] </span></pre></div> </td></tr></table>

Text only

My list

[]
https://snipt.net/embed/220a3f7e75f2433c368aeb5611b9b734/
/raw/220a3f7e75f2433c368aeb5611b9b734/
220a3f7e75f2433c368aeb5611b9b734
text
Text only
1
2019-08-21T22:31:48
True
False
False
/api/public/snipt/281922/
my-list-c7dc36ec
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>[] </span></pre></div> </td></tr></table>