<?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 help needed with splunk search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/help-needed-with-splunk-search/m-p/23775#M177485</link>
    <description>&lt;P&gt;hello i have a problem with splunk results. in some of the RAW logs i have a field called as "ref" and in some logs i dont have that field. i want splunk to display the results even when a a particular field is missing.&lt;/P&gt;

&lt;P&gt;for example:&lt;/P&gt;

&lt;P&gt;query: index=pci_bpo_index device_id="FG*" type="virus" | stats count by log_id subtype msg status devname url | sort -10count&lt;/P&gt;

&lt;P&gt;i get 246 results &lt;/P&gt;

&lt;P&gt;and if i include the word ref in my search only 1 result comes out. i need to find a way for splunk to show me 246 results even if ref field is not included in the 245 RAW logs.&lt;/P&gt;

&lt;P&gt;is their a "AND" 'OR" function we can use in our search which can solve this issue.&lt;/P&gt;

&lt;P&gt;query: index=pci_bpo_index device_id="FG*" type="virus" | stats count by log_id subtype msg status devname url &lt;STRONG&gt;ref&lt;/STRONG&gt; | sort -10count&lt;/P&gt;

&lt;P&gt;if i include ref my result comes out to be only 1.&lt;/P&gt;

&lt;P&gt;example of RAW logs&lt;/P&gt;

&lt;P&gt;with ref field : &lt;/P&gt;

&lt;P&gt;log_id=0211008192 type=virus subtype=infected pri=warning vd=root msg="File is infected." status=passthrough service=mm1 src=1.1.1.1 dst=2.2.2.2 sport=2560 src_port=2560 dport=5120 dst_port=5120 src_int=lo dst_int=dummy0 policyid=12345 identidx=67890 serial=312 dir=rx file=file_name checksum=N/A quarskip="No skip" virus=virus dtype=cat &lt;STRONG&gt;ref=fortinet/ve?vid=1 url=N/A carrier_ep="carrier endpoint&lt;/STRONG&gt;" profile=N/A profiletype=N/A profilegroup=N/A user=user group=group agent=N/A from=N/A to=N/A&lt;/P&gt;

&lt;P&gt;example without ref : log_id=0212008452 type=virus subtype=filename pri=warning vd=root msg="Command blocked." status=blocked service=ftp src=172.17.100.230 dst=172.19.125.98 sport=2620 src_port=2620 dport=21 dst_port=21 src_int=lan4 dst_int=wan1 policyid=2044 identidx=0 serial=218566 url=N/A user=N/A group=N/A command=REST&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 14:29:49 GMT</pubDate>
    <dc:creator>ssehgal</dc:creator>
    <dc:date>2020-09-28T14:29:49Z</dc:date>
    <item>
      <title>help needed with splunk search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-needed-with-splunk-search/m-p/23775#M177485</link>
      <description>&lt;P&gt;hello i have a problem with splunk results. in some of the RAW logs i have a field called as "ref" and in some logs i dont have that field. i want splunk to display the results even when a a particular field is missing.&lt;/P&gt;

&lt;P&gt;for example:&lt;/P&gt;

&lt;P&gt;query: index=pci_bpo_index device_id="FG*" type="virus" | stats count by log_id subtype msg status devname url | sort -10count&lt;/P&gt;

&lt;P&gt;i get 246 results &lt;/P&gt;

&lt;P&gt;and if i include the word ref in my search only 1 result comes out. i need to find a way for splunk to show me 246 results even if ref field is not included in the 245 RAW logs.&lt;/P&gt;

&lt;P&gt;is their a "AND" 'OR" function we can use in our search which can solve this issue.&lt;/P&gt;

&lt;P&gt;query: index=pci_bpo_index device_id="FG*" type="virus" | stats count by log_id subtype msg status devname url &lt;STRONG&gt;ref&lt;/STRONG&gt; | sort -10count&lt;/P&gt;

&lt;P&gt;if i include ref my result comes out to be only 1.&lt;/P&gt;

&lt;P&gt;example of RAW logs&lt;/P&gt;

&lt;P&gt;with ref field : &lt;/P&gt;

&lt;P&gt;log_id=0211008192 type=virus subtype=infected pri=warning vd=root msg="File is infected." status=passthrough service=mm1 src=1.1.1.1 dst=2.2.2.2 sport=2560 src_port=2560 dport=5120 dst_port=5120 src_int=lo dst_int=dummy0 policyid=12345 identidx=67890 serial=312 dir=rx file=file_name checksum=N/A quarskip="No skip" virus=virus dtype=cat &lt;STRONG&gt;ref=fortinet/ve?vid=1 url=N/A carrier_ep="carrier endpoint&lt;/STRONG&gt;" profile=N/A profiletype=N/A profilegroup=N/A user=user group=group agent=N/A from=N/A to=N/A&lt;/P&gt;

&lt;P&gt;example without ref : log_id=0212008452 type=virus subtype=filename pri=warning vd=root msg="Command blocked." status=blocked service=ftp src=172.17.100.230 dst=172.19.125.98 sport=2620 src_port=2620 dport=21 dst_port=21 src_int=lan4 dst_int=wan1 policyid=2044 identidx=0 serial=218566 url=N/A user=N/A group=N/A command=REST&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:29:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-needed-with-splunk-search/m-p/23775#M177485</guid>
      <dc:creator>ssehgal</dc:creator>
      <dc:date>2020-09-28T14:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: help needed with splunk search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-needed-with-splunk-search/m-p/23776#M177486</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=pci_bpo_index device_id="FG*" type="virus" 
| fillnull value=" " ref
| stats count by log_id subtype msg status devname url ref 
| sort -10 count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which sets &lt;CODE&gt;ref&lt;/CODE&gt; to spaces for events that do not have a &lt;CODE&gt;ref&lt;/CODE&gt; field.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2013 20:13:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-needed-with-splunk-search/m-p/23776#M177486</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-08-02T20:13:42Z</dc:date>
    </item>
  </channel>
</rss>

