<?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: Simple search extraction for lines of text with spaces ??? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Simple-search-extraction-for-lines-of-text-with-spaces/m-p/419818#M120703</link>
    <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"CommandLine: net share" | regex "(?m)[\r\n\s]CommandLine: net share"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 21 Jan 2019 19:41:08 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-01-21T19:41:08Z</dc:date>
    <item>
      <title>Simple search extraction for lines of text with spaces ???</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Simple-search-extraction-for-lines-of-text-with-spaces/m-p/419814#M120699</link>
      <description>&lt;P&gt;Hey Guys, &lt;/P&gt;

&lt;P&gt;I seem to be struggling to pull out some what I thought would be simple searches.&lt;/P&gt;

&lt;P&gt;An example result could look like this - &lt;/P&gt;

&lt;P&gt;CommandLine: net share&lt;/P&gt;

&lt;P&gt;So how would I run a search to bring back only "CommandLine: net share" from within eventsas the results and not every event that contains CommandLine: and or net and or share &lt;/P&gt;

&lt;P&gt;Thanks &lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 15:13:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Simple-search-extraction-for-lines-of-text-with-spaces/m-p/419814#M120699</guid>
      <dc:creator>AaronMoorcroft</dc:creator>
      <dc:date>2019-01-21T15:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: Simple search extraction for lines of text with spaces ???</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Simple-search-extraction-for-lines-of-text-with-spaces/m-p/419815#M120700</link>
      <description>&lt;P&gt;Hi AaronMoorcroft,&lt;BR /&gt;
sorry but I'm not sure to have understood your question because answer is too easy:&lt;BR /&gt;
do you want to insert in a search the exact string "CommandLine: net share" and not every single word?&lt;/P&gt;

&lt;P&gt;if this is your question, answer is very simple:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my_index "CommandLine: net share"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this way you're sure to find only the exact string and not the single words.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 15:43:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Simple-search-extraction-for-lines-of-text-with-spaces/m-p/419815#M120700</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-01-21T15:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: Simple search extraction for lines of text with spaces ???</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Simple-search-extraction-for-lines-of-text-with-spaces/m-p/419816#M120701</link>
      <description>&lt;P&gt;Hey Cusello,&lt;/P&gt;

&lt;P&gt;you would think so right but that brings back no results for me at all, however if I do a ("CommandLine:" AND "net" AND "share" that will bring back some results as shown below however it brings back events that just contain either 1 or 2 of the other words where all I really want to see is events containing the exact match of "CommandLine: net share"&lt;/P&gt;

&lt;P&gt;Dont worry the below systems are throw away lab systems so no corp data is available &lt;/P&gt;

&lt;P&gt;Time    Event&lt;BR /&gt;
1/21/19&lt;BR /&gt;
1:48:09.000 PM&lt;BR /&gt;&lt;BR /&gt;
01/21/2019 01:48:09 PM&lt;BR /&gt;
LogName=Microsoft-Windows-Sysmon/Operational&lt;BR /&gt;
SourceName=Microsoft-Windows-Sysmon&lt;BR /&gt;
EventCode=1&lt;BR /&gt;
EventType=4&lt;BR /&gt;
Type=Information&lt;BR /&gt;
ComputerName=DC01.PurpleHaze.local&lt;BR /&gt;
User=NOT_TRANSLATED&lt;BR /&gt;
Sid=S-1-5-18&lt;BR /&gt;
SidType=0&lt;BR /&gt;
TaskCategory=Process Create (rule: ProcessCreate)&lt;BR /&gt;
OpCode=Info&lt;BR /&gt;
RecordNumber=431111&lt;BR /&gt;
Keywords=None&lt;BR /&gt;
Message=Process Create:&lt;BR /&gt;
RuleName: &lt;BR /&gt;
UtcTime: 2019-01-21 13:48:09.340&lt;BR /&gt;
ProcessGuid: {834924C0-CD99-5C45-0000-0010B3DAC700}&lt;BR /&gt;
ProcessId: 4680&lt;BR /&gt;
Image: C:\Windows\SysWOW64\net1.exe&lt;BR /&gt;
FileVersion: 10.0.14393.0 (rs1_release.160715-1616)&lt;BR /&gt;
Description: Net Command&lt;BR /&gt;
Product: Microsoft® Windows® Operating System&lt;BR /&gt;
Company: Microsoft Corporation&lt;BR /&gt;
CommandLine: C:\Windows\system32\net1  share &lt;BR /&gt;
CurrentDirectory: C:\Windows\system32\&lt;BR /&gt;
User: NT AUTHORITY\SYSTEM&lt;BR /&gt;
LogonGuid: {834924C0-3E0A-5C40-0000-0020E7030000}&lt;BR /&gt;
LogonId: 0x3E7&lt;BR /&gt;
TerminalSessionId: 0&lt;BR /&gt;
IntegrityLevel: System&lt;BR /&gt;
Hashes: SHA1=382169595D5BBEB535C4575B3EC8CC7E5E933115&lt;BR /&gt;
ParentProcessGuid: {834924C0-CD99-5C45-0000-00100FDAC700}&lt;BR /&gt;
ParentProcessId: 1540&lt;BR /&gt;
ParentImage: C:\Windows\SysWOW64\net.exe&lt;BR /&gt;
ParentCommandLine: net  share&lt;BR /&gt;
Collapse&lt;BR /&gt;
CommandLine =   C:\Windows\system32\net1 share host =   DC01 source =   WinEventLog:Microsoft-Windows-Sysmon/Operational sourcetype =   WinEventLog:Microsoft-Windows-Sysmon/Operational&lt;/P&gt;

&lt;P&gt;1/21/19&lt;BR /&gt;
1:48:09.000 PM&lt;BR /&gt;&lt;BR /&gt;
01/21/2019 01:48:09 PM&lt;BR /&gt;
LogName=Microsoft-Windows-Sysmon/Operational&lt;BR /&gt;
SourceName=Microsoft-Windows-Sysmon&lt;BR /&gt;
EventCode=1&lt;BR /&gt;
EventType=4&lt;BR /&gt;
Type=Information&lt;BR /&gt;
ComputerName=DC01.PurpleHaze.local&lt;BR /&gt;
User=NOT_TRANSLATED&lt;BR /&gt;
Sid=S-1-5-18&lt;BR /&gt;
SidType=0&lt;BR /&gt;
TaskCategory=Process Create (rule: ProcessCreate)&lt;BR /&gt;
OpCode=Info&lt;BR /&gt;
RecordNumber=431110&lt;BR /&gt;
Keywords=None&lt;BR /&gt;
Message=Process Create:&lt;BR /&gt;
RuleName: &lt;BR /&gt;
UtcTime: 2019-01-21 13:48:09.330&lt;BR /&gt;
ProcessGuid: {834924C0-CD99-5C45-0000-00100FDAC700}&lt;BR /&gt;
ProcessId: 1540&lt;BR /&gt;
Image: C:\Windows\SysWOW64\net.exe&lt;BR /&gt;
FileVersion: 10.0.14393.0 (rs1_release.160715-1616)&lt;BR /&gt;
Description: Net Command&lt;BR /&gt;
Product: Microsoft® Windows® Operating System&lt;BR /&gt;
Company: Microsoft Corporation&lt;BR /&gt;
&lt;STRONG&gt;CommandLine: net  share&lt;/STRONG&gt; &lt;BR /&gt;
CurrentDirectory: C:\Windows\system32\&lt;BR /&gt;
User: NT AUTHORITY\SYSTEM&lt;BR /&gt;
LogonGuid: {834924C0-3E0A-5C40-0000-0020E7030000}&lt;BR /&gt;
LogonId: 0x3E7&lt;BR /&gt;
TerminalSessionId: 0&lt;BR /&gt;
IntegrityLevel: System&lt;BR /&gt;
Hashes: SHA1=B160F4462A4728BEC8FA053B99709622A4B4DD20&lt;BR /&gt;
ParentProcessGuid: {834924C0-C9D7-5C45-0000-0010FCA2C500}&lt;BR /&gt;
ParentProcessId: 3064&lt;BR /&gt;
ParentImage: C:\Windows\SysWOW64\cmd.exe&lt;BR /&gt;
ParentCommandLine: C:\Windows\system32\cmd.exe&lt;BR /&gt;
Collapse&lt;BR /&gt;
CommandLine =   net share host =    DC01 source =   WinEventLog:Microsoft-Windows-Sysmon/Operational sourcetype =   WinEventLog:Microsoft-Windows-Sysmon/Operational&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:53:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Simple-search-extraction-for-lines-of-text-with-spaces/m-p/419816#M120701</guid>
      <dc:creator>AaronMoorcroft</dc:creator>
      <dc:date>2020-09-29T22:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Simple search extraction for lines of text with spaces ???</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Simple-search-extraction-for-lines-of-text-with-spaces/m-p/419817#M120702</link>
      <description>&lt;P&gt;Hi AaronMoorcroft,&lt;BR /&gt;
in the first sample you shared I see:&lt;BR /&gt;
&lt;CODE&gt;ParentCommandLine: net share&lt;/CODE&gt; that matches your string but before the string there's an additional word, instead in the second one I see &lt;CODE&gt;CommandLine: net share&lt;/CODE&gt; that exactly matches your search.&lt;BR /&gt;
To distinguish the two events, you could use the regex command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| regex "\s+CommandLine: net share"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you can test it at &lt;A href="https://regex101.com/r/N9cnAe/1"&gt;https://regex101.com/r/N9cnAe/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 16:24:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Simple-search-extraction-for-lines-of-text-with-spaces/m-p/419817#M120702</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-01-21T16:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: Simple search extraction for lines of text with spaces ???</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Simple-search-extraction-for-lines-of-text-with-spaces/m-p/419818#M120703</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"CommandLine: net share" | regex "(?m)[\r\n\s]CommandLine: net share"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Jan 2019 19:41:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Simple-search-extraction-for-lines-of-text-with-spaces/m-p/419818#M120703</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-01-21T19:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: Simple search extraction for lines of text with spaces ???</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Simple-search-extraction-for-lines-of-text-with-spaces/m-p/419819#M120704</link>
      <description>&lt;P&gt;Hey guys,&lt;/P&gt;

&lt;P&gt;Thanks for the advice, still not working im afraid, I can see that it works on Regex101 also managed to get it working on Regex101 with ^[a-zA-Z]+:[\s[a-z]+\s[a-z]+$&lt;/P&gt;

&lt;P&gt;When its thrown into Splunk it still doesn't work, I swappped the [ ] for ( ) too as [ ] dont work in Splunk.... Ill keep trying &lt;/P&gt;

&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 14:43:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Simple-search-extraction-for-lines-of-text-with-spaces/m-p/419819#M120704</guid>
      <dc:creator>AaronMoorcroft</dc:creator>
      <dc:date>2019-01-22T14:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Simple search extraction for lines of text with spaces ???</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Simple-search-extraction-for-lines-of-text-with-spaces/m-p/419820#M120705</link>
      <description>&lt;P&gt;I updated my answer.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 15:26:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Simple-search-extraction-for-lines-of-text-with-spaces/m-p/419820#M120705</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-01-22T15:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: Simple search extraction for lines of text with spaces ???</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Simple-search-extraction-for-lines-of-text-with-spaces/m-p/419821#M120706</link>
      <description>&lt;P&gt;still the same i'm afraid no results... very much appreciate your assistance though &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 15:38:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Simple-search-extraction-for-lines-of-text-with-spaces/m-p/419821#M120706</guid>
      <dc:creator>AaronMoorcroft</dc:creator>
      <dc:date>2019-01-22T15:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Simple search extraction for lines of text with spaces ???</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Simple-search-extraction-for-lines-of-text-with-spaces/m-p/419822#M120707</link>
      <description>&lt;P&gt;You must not swap &lt;CODE&gt;[]&lt;/CODE&gt; for &lt;CODE&gt;()&lt;/CODE&gt; because it completely changes the RegEx.  Did you try mine &lt;EM&gt;exactly&lt;/EM&gt; as I showed it or did you modify it?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 15:44:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Simple-search-extraction-for-lines-of-text-with-spaces/m-p/419822#M120707</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-01-22T15:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: Simple search extraction for lines of text with spaces ???</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Simple-search-extraction-for-lines-of-text-with-spaces/m-p/419823#M120708</link>
      <description>&lt;P&gt;exactly as yours pal&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 15:48:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Simple-search-extraction-for-lines-of-text-with-spaces/m-p/419823#M120708</guid>
      <dc:creator>AaronMoorcroft</dc:creator>
      <dc:date>2019-01-22T15:48:44Z</dc:date>
    </item>
  </channel>
</rss>

