<?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 search that shows the current uptime of the server? and the date / time / user who last reboot the server? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-that-shows-the-current-uptime-of-the-server-and/m-p/588467#M204963</link>
    <description>&lt;P&gt;Any updates? If this works accept the answer to close the question.&lt;/P&gt;</description>
    <pubDate>Thu, 10 Mar 2022 17:33:08 GMT</pubDate>
    <dc:creator>ricotries</dc:creator>
    <dc:date>2022-03-10T17:33:08Z</dc:date>
    <item>
      <title>How to search that shows the current uptime of the server? and the date / time / user who last reboot the server?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-that-shows-the-current-uptime-of-the-server-and/m-p/587995#M204784</link>
      <description>&lt;P&gt;&lt;SPAN&gt;How to search that shows the current uptime of the server? and the date / time / user who last reboot the server?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2022 17:55:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-that-shows-the-current-uptime-of-the-server-and/m-p/587995#M204784</guid>
      <dc:creator>afraanajam</dc:creator>
      <dc:date>2022-03-08T17:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to search that shows the current uptime of the server? and the date / time / user who last reboot the server?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-that-shows-the-current-uptime-of-the-server-and/m-p/588129#M204821</link>
      <description>&lt;P&gt;What you are asking depends on the operating system of the host you are asking for. Windows devices will log the information you are asking for differently than a *nix device.&lt;/P&gt;&lt;P&gt;If you are looking for the current uptime of a Splunk process (say Splunk Enterprise), you can run the following search:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal host=&amp;lt;hostname&amp;gt; "My hostname is"
| eval uptime_hours = round((now() - _time) / (60 * 60), 1)
| table uptime_hours&lt;/LI-CODE&gt;&lt;P&gt;$SPLUNK_HOME/var/log/splunk/splunkd.log writes the message "My hostname is "&amp;lt;hostname&amp;gt;"" when an instance of Splunk is first started, so we can use this timestamp to determine the current uptime if a Splunk instance.&lt;/P&gt;&lt;P&gt;To answer the rest of your question we need more information.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2022 23:00:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-that-shows-the-current-uptime-of-the-server-and/m-p/588129#M204821</guid>
      <dc:creator>ricotries</dc:creator>
      <dc:date>2022-03-08T23:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to search that shows the current uptime of the server? and the date / time / user who last reboot the server?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-that-shows-the-current-uptime-of-the-server-and/m-p/588144#M204827</link>
      <description>&lt;P&gt;This is Windows boxes..What would be search for finding last reboot of server using event logs..&lt;SPAN&gt;and the date / time / user who last reboot the server?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 06:05:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-that-shows-the-current-uptime-of-the-server-and/m-p/588144#M204827</guid>
      <dc:creator>afraanajam</dc:creator>
      <dc:date>2022-03-09T06:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to search that shows the current uptime of the server? and the date / time / user who last reboot the server?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-that-shows-the-current-uptime-of-the-server-and/m-p/588267#M204871</link>
      <description>&lt;P&gt;The Event ID you are looking for is 1074. The syntax for this Event ID is (where %% are variables):&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;The process %% has initiated the %% of computer %% on behalf of user %% for the following reason: %%
Reason Code: %%
Shutdown Type: %%
Comment: %%&lt;/LI-CODE&gt;&lt;P&gt;Since we don't know if field extraction is set up and the custom field names in your environment, we'll do a rex command (we'll assume the EventID is stored in the field EventCode at a minimum):&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype="WinEventLog:*" EventCode=1074
| rex field=_raw "The process [^ ]+ has initiated the restart of computer (?&amp;lt;computer&amp;gt;[^ ]+) on behalf of user (?&amp;lt;calling_user&amp;gt;[^ ]+) for the following reason: (?&amp;lt;poweroff_reason&amp;gt;.*)"
| head 1
| table _time computer calling_user poweroff_reason&lt;/LI-CODE&gt;&lt;P&gt;If field extraction is being done, remove the rex command and simply replace the field names in the table command.&lt;/P&gt;&lt;P&gt;Reference:&lt;/P&gt;&lt;P&gt;&lt;A href="https://kb.eventtracker.com/evtpass/evtpages/EventId_1074_User32_46330.asp" target="_blank"&gt;https://kb.eventtracker.com/evtpass/evtpages/EventId_1074_User32_46330.asp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://shellgeek.com/event-id-1074-system-restart-or-shutdown/" target="_blank"&gt;https://shellgeek.com/event-id-1074-system-restart-or-shutdown/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 16:24:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-that-shows-the-current-uptime-of-the-server-and/m-p/588267#M204871</guid>
      <dc:creator>ricotries</dc:creator>
      <dc:date>2022-03-09T16:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to search that shows the current uptime of the server? and the date / time / user who last reboot the server?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-that-shows-the-current-uptime-of-the-server-and/m-p/588467#M204963</link>
      <description>&lt;P&gt;Any updates? If this works accept the answer to close the question.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 17:33:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-that-shows-the-current-uptime-of-the-server-and/m-p/588467#M204963</guid>
      <dc:creator>ricotries</dc:creator>
      <dc:date>2022-03-10T17:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to search that shows the current uptime of the server? and the date / time / user who last reboot the server?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-that-shows-the-current-uptime-of-the-server-and/m-p/588861#M205079</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you above search worked but its not giving calling_user and Poweroff_reason details..Is anything need to modify in search..Pls advice..&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 01:27:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-that-shows-the-current-uptime-of-the-server-and/m-p/588861#M205079</guid>
      <dc:creator>afraanajam</dc:creator>
      <dc:date>2022-03-14T01:27:33Z</dc:date>
    </item>
  </channel>
</rss>

