Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
knowledge_graph
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sun Long
knowledge_graph
Commits
60d1bf7e
Commit
60d1bf7e
authored
Apr 25, 2022
by
lyh3024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
Change-Id: Iaf58046ff879e3c25f51169bd7407a3930907b89
parent
7ec8ca56
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
views.py
domain/views.py
+2
-1
No files found.
domain/views.py
View file @
60d1bf7e
...
...
@@ -37,7 +37,7 @@ def get_request_ips(label, from_time, end_time):
'where l.label_name = $label and req.date >= $from_time and req.date <= $end_time return r.request_ip'
else
:
param
=
{
"label"
:
label
}
query
=
'match (r:RequestIp)-[]->(d:DomainName)-[]->(l:Label) where l.label_name = $label return r'
query
=
'match (r:RequestIp)-[]->(d:DomainName)-[]->(l:Label) where l.label_name = $label return r
.request_ip
'
nodes
=
db
.
cypher_query
(
query
,
param
)[
0
]
ips
=
[
node
[
0
]
for
node
in
nodes
]
else
:
...
...
@@ -76,6 +76,7 @@ def get_domain_list(request):
resp
=
tools
.
dec_success_resp
({
"nodes"
:
resp_nodes
,
"relations"
:
resp_relations
})
return
JsonResponse
(
resp
,
safe
=
False
)
print
(
ips
)
param
=
{
"ips"
:
ips
}
query
=
'match (r:RequestIp)-[req:REQUEST]->(d:DomainName)-[lab:LABEL]->(l:Label), (dns:DnsIp)-[par:PARSE]->(d)'
\
'where r.request_ip in $ips return r, d, l, dns, req, lab, par'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment