<?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: Search bash_history in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-bash-history/m-p/519749#M146378</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=_raw mode=sed "s/^#\d+\s?//g"
| where _raw!=""&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Sep 2020 16:04:15 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2020-09-15T16:04:15Z</dc:date>
    <item>
      <title>Search bash_history</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-bash-history/m-p/519744#M146376</link>
      <description>&lt;P&gt;Adhoc search of bash_history files and attempting to just pull out listing of commands regardless of the timestamp value.&amp;nbsp;I am not interested at this point in retrieving the Timestamp.&lt;/P&gt;&lt;P&gt;Here is what a given search returns:&lt;/P&gt;&lt;P&gt;Event 1 #1597921243 &amp;lt;-- Timestamp&lt;BR /&gt;whoami&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;-- Command whoami is returned as part of Event 1&lt;BR /&gt;Event 2 uname&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;-- Command uname is returned as a unique Event&lt;BR /&gt;Event 3 #1597921243 &amp;lt;-- Timestamp returned as unique event&lt;BR /&gt;Event 4 df -h&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;-- Command df -h is returned as a unique Event&lt;BR /&gt;Event 5 #1597678043 &amp;lt;-- Timestamp returned as unique event&lt;/P&gt;&lt;P&gt;When I execute this Search only Event 1 is returned which is Timestamp and separate line with whoami command&lt;BR /&gt;&lt;BR /&gt;index=os sourcetype=bash_history host=my_host_name |regex "^#\d+\s+(?P&amp;lt;PGCMD&amp;gt;\w+)"&lt;/P&gt;&lt;P&gt;When I execute this Search 3 Events are returned, Event 1 (TS + whoami) and Event 2 (uname) and Event 4 (df)&lt;/P&gt;&lt;P&gt;index=os sourcetype=bash_history host=my_host_name |regex "[a-zA-Z]+"&lt;/P&gt;&lt;P&gt;When I execute this Search 2 Events are returned, Event 2 (uname) and Event 4 (df)&lt;/P&gt;&lt;P&gt;index=os sourcetype=bash_history host=ps2pr608661 |regex "^\w+"&lt;/P&gt;&lt;P&gt;What I am trying to end up with is just viewing the commands, no time stamps, in essence results should just be whoami, uname and df -h nothing else&lt;/P&gt;&lt;P&gt;I've been searching for a solution but 1.5 days into this I cannot find one. Any help is appreciated&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2020 15:49:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-bash-history/m-p/519744#M146376</guid>
      <dc:creator>p544gm</dc:creator>
      <dc:date>2020-09-15T15:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Search bash_history</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-bash-history/m-p/519749#M146378</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=_raw mode=sed "s/^#\d+\s?//g"
| where _raw!=""&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2020 16:04:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-bash-history/m-p/519749#M146378</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-09-15T16:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: Search bash_history</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-bash-history/m-p/519750#M146379</link>
      <description>&lt;P&gt;fantastic! worked like a charm. Was unaware I could use sed. It's a good day when you learn something new! Thank you for quick reply and solution.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2020 16:17:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-bash-history/m-p/519750#M146379</guid>
      <dc:creator>p544gm</dc:creator>
      <dc:date>2020-09-15T16:17:17Z</dc:date>
    </item>
  </channel>
</rss>

