<?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: Help on stats and on regex in a same query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-on-stats-and-on-regex-in-a-same-query/m-p/413077#M174378</link>
    <description>&lt;P&gt;I found...&lt;BR /&gt;
It was due to dedup host....&lt;BR /&gt;
so it is possible now to help me with the issue with rex field=LastLogon&lt;BR /&gt;
The format of the field is like this : LastLogon=20181128075540.000000+060 but I want to have a date format like this : 28/11/2018 05:55&lt;BR /&gt;
thanks&lt;/P&gt;</description>
    <pubDate>Wed, 28 Nov 2018 15:10:27 GMT</pubDate>
    <dc:creator>jip31</dc:creator>
    <dc:date>2018-11-28T15:10:27Z</dc:date>
    <item>
      <title>Help on stats and on regex in a same query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-stats-and-on-regex-in-a-same-query/m-p/413072#M174373</link>
      <description>&lt;P&gt;hello I use the code below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="windows-wmi" (sourcetype="WMI:LastLogon" OR sourcetype="WMI:LastReboot")
| dedup host 

| eval LastLogon = strptime(LastLogon,"%Y%m%d%H%M%S") | rex field=LastLogon mode=sed "s/\..*$$//" | eval LastBootUpTime = strftime(strptime(LastBootUpTime,"%Y%m%d%H%M%S"),"%d/%m/%Y %H:%M") 
| rex field=LastBootUpTime mode=sed "s/\..*$$//" 

| stats latest(LastLogon) as LastLogon, latest(LastBootUpTime) as LastReboot by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have results for LastBootUpTime but not for LastLogon&lt;BR /&gt;
When I just execute the code below I have results for LastLogon&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="windows-wmi" (sourcetype="WMI:LastLogon") 
| dedup host 
| eval LastLogon = strptime(LastLogon,"%Y%m%d%H%M%S") 
| rex field=LastLogon mode=sed "s/\..*$$//" 
| stats latest(LastLogon) as LastLogon by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What is the problem please&lt;BR /&gt;
Other issue with rex field=LastLogon&lt;BR /&gt;
The format of the field is like this : LastLogon=20181128075540.000000+060 but I want to have a date format like this : 28/11/2018 05:55&lt;BR /&gt;
Could you help me please?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 07:14:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-stats-and-on-regex-in-a-same-query/m-p/413072#M174373</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2018-11-28T07:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: Help on stats and on regex in a same query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-stats-and-on-regex-in-a-same-query/m-p/413073#M174374</link>
      <description>&lt;P&gt;Hi.. did you try like this(rex sed after finding out the LastBootUpTime):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="windows-wmi" (sourcetype="WMI:LastLogon") 
 | dedup host 
 | eval LastLogon = strptime(LastLogon,"%Y%m%d%H%M%S") 
 | eval LastBootUpTime = strftime(strptime(LastBootUpTime,"%Y%m%d%H%M%S"),"%d/%m/%Y %H:%M") 
 | rex field=LastLogon mode=sed "s/\..*$$//" 
| stats latest(LastLogon) as LastLogon, latest(LastBootUpTime) as LastReboot by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Nov 2018 08:28:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-stats-and-on-regex-in-a-same-query/m-p/413073#M174374</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2018-11-28T08:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help on stats and on regex in a same query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-stats-and-on-regex-in-a-same-query/m-p/413074#M174375</link>
      <description>&lt;P&gt;try this&lt;/P&gt;

&lt;P&gt;index="windows-wmi" (sourcetype="WMI:LastLogon" OR sourcetype="WMI:LastReboot") &lt;BR /&gt;
  | dedup host,sourcetype&lt;BR /&gt;
  | eval LastLogon = strptime(LastLogon,"%Y%m%d%H%M%S") &lt;BR /&gt;
  | eval LastBootUpTime = strftime(strptime(LastBootUpTime,"%Y%m%d%H%M%S"),"%d/%m/%Y %H:%M") &lt;BR /&gt;
  | rex field=LastLogon mode=sed "s/..*$$//" &lt;BR /&gt;
 | stats latest(LastLogon) as LastLogon, latest(LastBootUpTime) as LastReboot by host&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 08:38:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-stats-and-on-regex-in-a-same-query/m-p/413074#M174375</guid>
      <dc:creator>accsam</dc:creator>
      <dc:date>2018-11-28T08:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Help on stats and on regex in a same query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-stats-and-on-regex-in-a-same-query/m-p/413075#M174376</link>
      <description>&lt;P&gt;HI&lt;/P&gt;

&lt;P&gt;With your code  I have now results for LastLogon but not for LastBootUpTime...&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 14:58:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-stats-and-on-regex-in-a-same-query/m-p/413075#M174376</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2018-11-28T14:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help on stats and on regex in a same query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-stats-and-on-regex-in-a-same-query/m-p/413076#M174377</link>
      <description>&lt;P&gt;no sorry I forgot sourcetype="WMI:LastReboot"&lt;BR /&gt;
so with your code nothing change&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 15:04:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-stats-and-on-regex-in-a-same-query/m-p/413076#M174377</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2018-11-28T15:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Help on stats and on regex in a same query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-stats-and-on-regex-in-a-same-query/m-p/413077#M174378</link>
      <description>&lt;P&gt;I found...&lt;BR /&gt;
It was due to dedup host....&lt;BR /&gt;
so it is possible now to help me with the issue with rex field=LastLogon&lt;BR /&gt;
The format of the field is like this : LastLogon=20181128075540.000000+060 but I want to have a date format like this : 28/11/2018 05:55&lt;BR /&gt;
thanks&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 15:10:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-stats-and-on-regex-in-a-same-query/m-p/413077#M174378</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2018-11-28T15:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: Help on stats and on regex in a same query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-stats-and-on-regex-in-a-same-query/m-p/413078#M174379</link>
      <description>&lt;P&gt;Have you tried my answer&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2018 04:19:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-stats-and-on-regex-in-a-same-query/m-p/413078#M174379</guid>
      <dc:creator>accsam</dc:creator>
      <dc:date>2018-11-29T04:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Help on stats and on regex in a same query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-stats-and-on-regex-in-a-same-query/m-p/413079#M174380</link>
      <description>&lt;P&gt;yes, when I use you regex | rex field=LastLogon mode=sed "s/..*$$//"  have have any results....&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2018 06:52:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-stats-and-on-regex-in-a-same-query/m-p/413079#M174380</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2018-11-29T06:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help on stats and on regex in a same query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-on-stats-and-on-regex-in-a-same-query/m-p/413080#M174381</link>
      <description>&lt;P&gt;I found :&lt;BR /&gt;
    | eval LastLogon = strftime(strptime(LastLogon,"%Y%m%d%H%M%S"),"%d/%m/%Y %H:%M") | rex field=LastLogon mode=sed "s/..*$//" | &lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2018 06:56:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-on-stats-and-on-regex-in-a-same-query/m-p/413080#M174381</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2018-11-29T06:56:16Z</dc:date>
    </item>
  </channel>
</rss>

