Questions tagged [parsing]
The parsing tag has no usage guidance.
45
questions
2
votes
1
answer
151
views
How to parse and filter on dict values on Ansible?
I'm currently working on a playbook to create a K8s cluster on Nutanix Prism Central. Everything run smoothly but i face an issue while a VLAN exists on one or more clusters.
In my case, a VLAN is ...
0
votes
1
answer
64
views
Odd behavior of bash array
I've recently encountered a strange script behavior and still don't understand y the array behaves this way.
Here is a piece of the script:
for nCDATAReg in $(seq 1 4)
do
sTestBuffer1=$(...
0
votes
1
answer
2k
views
Ansible having an unhandled exception occurred while templating with lookup function
I'm currently building a playbook to test if some conf files are existing and then check the contents. Files are the following
/etc/resolv.conf - then check if nameservers are well configured
/etc/...
0
votes
2
answers
557
views
sed: -e expression #1, char 113: unknown command: `['
I was wondering why isn't this code working, it is simple but for some reason it's not working.
WIREGUARD_TEMP_NEW_CLIENT_INFO="# ...
2
votes
1
answer
1k
views
Extracting TCP application data from pcap file
Given a .pcap (or similar) file, I'd like to select one TCP connection and dump both application data streams (the one from the other peer and the one two the other peer) into two separate files on ...
0
votes
1
answer
396
views
OpenVPN server log - what is the "us=" identifier following the timestamp?
I use OpenVPN 2.3.10 in server mode, with logging set to verb 4.
In the log, every line begins by a timestamp (Mon May 11 10:40:10 2020) and then us=, followed by a 5- or 6-digit number. What is this ...
0
votes
1
answer
667
views
Extracting responses from Microsoft DNS Server Analytical logs
Is it possible to extract the DNS responses from Microsoft DNS Server Analytical logs (Microsoft-Windows-DNS-Server/Analytical)? The logs contain a field called "PacketData" in the EventData section ...
1
vote
1
answer
750
views
Procmail not execute shell command
i need launch a script when receive an email with specific subject, i've try fetchmail + procmail, this my configuration
.fetchmailrc
set no bouncemail
defaults:
antispam -1
batchlimit 100
poll ...
2
votes
2
answers
5k
views
Ansible parsing a JSON output
I'm using URI in order to get a JSOn output to a register called "vchosts"
TASK [debug] ****************************************************************************************************************...
1
vote
2
answers
749
views
Determine the end of a malformed (bad) http request
I'm implementing a HTTP server and wonder, if there is a defined way of when a server would determine a bad request as ended to
return the corresponding 400 status, and
accept the following data as ...
0
votes
0
answers
173
views
How to display traffic information in a parsable format?
tcpdump is my go-to tool to analyze traffic (together with Wireshark when I want an easier review of the pcap file).
This fantastic tool fails however to deliver a predictable and easy to parse ...
0
votes
1
answer
5k
views
HAProxy errors in configuration file
I am trying to configure Pass through SSL using HAproxy but I get a lot of errors
here my example
error detected while parsing ACL
frontend public_ssl
mode tcp
option tcplog
...
1
vote
1
answer
3k
views
Changing all HTML absolute links to relative [closed]
I have a website that has a bunch of absolute addresses, and I need to move it (the whole contents of that website) up a level, so all of the absolute links need to be converted to relative.
I know ...
-2
votes
1
answer
280
views
puppet variable parsing inside quotes
How can I make the last exec resource parse variables?
Currently it is coming out blank inside rc.local file as such:
[root@server1 ~]# cat /etc/rc.local
#!/bin/sh
/usr/sbin/balance -b 127.0.0.1 ...
3
votes
0
answers
434
views
I am looking for software that can parse emails and expect emails within a grace period [closed]
I manage a diverse set of backup systems, the only commonality is email notifications, There status being Failed, Success, Success with exceptions and unknown(where the email isn't sent).
Case 1) ...
0
votes
1
answer
632
views
How I can parse email to get original recipient of an email? [closed]
I had email source with me and want parse original recipient of email.
Lets say "user1@example.com" is receiving a email, but in "To" list user1@example.com, user2@example.com & user3@example.com ...
0
votes
1
answer
52
views
Which log file can I use for server port analytics?
Ideally I'd like to use piwik to track conversions from ads to server connections on port 5000 and port 5001 but I highly doubt that is even possible.
I'm willing to settle for [ipaddress,time ...
0
votes
1
answer
1k
views
How to remove string and replace with content found in text file using batch script or powershell
How to remove string and replace with content found in text file using batch script.
test.txt
Version: 4.5.0
Import:
//MPackages/Project/config/abc.txt #head
//Packages/...
4
votes
4
answers
12k
views
AWS - Script to create EC2 snapshots and automatically rename them
I'm currently trying to setup a script (using AWS CLI from an Ubuntu server) that will do the following:
Create a snapshot of every existing volume. Those volumes already have a NAME tag (Like ...
3
votes
1
answer
609
views
Is there a way to determine the log format if given a ".log" file?
Is there a way to determine the kind of log (so that it can be parse correctly) if I have no prior information about the type (for eg. syslog, apache log, IIS log) of log it is? I am trying to write a ...
4
votes
2
answers
5k
views
PowerShell - Add multiple strings to the same element in an array
So I have a array that I need to search through line by line and divide up by interfaces. My code loops through this file line by line. I want to split up the interfaces by the "!" character and add ...
-1
votes
1
answer
137
views
how to set linux hostname based on flashdisk volume label [closed]
i'am running live linux, which run from FAT32 flashdisk
since i run a lot of pc using this flashdisk, its difficult to identify which IP for its hostname, since its ip need to be dynamically ...
7
votes
2
answers
6k
views
Parseable NGINX accesslog files with delimiters
The default NGINX format is this:
log_format combined '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$...
0
votes
1
answer
156
views
Parse requests per OS type apache log
I'm trying to return a sorted list of requests per OS type, parsed from an Apache access_log file (not combined format as I need the user-agent info). Here's an example of the output I'm looking for:
...
1
vote
3
answers
3k
views
In PowerShell, how can I parse a preformatted output?
Is there existing tooling to take text-based output and pipe it to a dynamic object that can be queried as columns?
Specifically, I'm invoking ..
query session /server:MYSERVER
.. which is ...
0
votes
3
answers
58
views
Listing usernames that are actually computers in Debian
I have inherited about 6 servers (all Debian based), and part of my project over the next year is consolidate everything into one server. There are 6 "domains" running from Samba3 installations, and I'...
1
vote
1
answer
1k
views
Parse Apache logfile and ban IPs
My server is under attack, it is flooded with request with the following pattern:
Thousands of IPs
Each IP request the same page "GET / HTTP/1.1" with the same referrer 3-5 times per second (same ...
3
votes
2
answers
5k
views
Scripts or tools to parse email message to remove attachment of particular name
I have configured Redmine email integration and while it's awesome, a major annoyance is that people have signatures that include a company logo, which then gets posted to every ticket they update via ...
4
votes
1
answer
114
views
How to handle many daily emails from cron efficiently?
With each new server comes at least one more daily crontab email. The FreeBSD servers even send two: a daily and a security run output. Thanks to my obsession with virtualisation the number of emails ...
3
votes
3
answers
10k
views
How can I limit the output of the whois command?
How do I get only the owner/orgname from a PTR whois lookup?
I don't need all the other entires, just the part about ownership (google in this case).
Edit /usr/bin/whois 74.125.236.52 or any ip
...
1
vote
1
answer
3k
views
Shell script to parse ip:port from a text file
I get daily a text file with ip:port, one per line, example:
11.22.33.44:80
22.33.44.55:8080
33.44.55.66:7777
I would like to parse the first ip and port in two different variables, then write them ...
5
votes
3
answers
141
views
Discover intended Foreign Keys from JOINS in scripts
I'm inheriting a database that has 400 tables and only 150 foreign key constraints registered. Knowing what I do about the application and looking at the table columns, it's easy to say that there ...
2
votes
2
answers
14k
views
Having difficulty getting multi-line Powershell regex to work - no matches
I referred to several examples I was able to search, which seemed highly pertinent, but am still unable to get this to work.
My input looks like this, from a dhcp server stats command, and I've ...
76
votes
5
answers
285k
views
How do I grep through binary files that look like text?
I have binary files that should be text (they're exported logs), but I can't open it with less (it looks ugly - it looks like a binary file). I found that I could open it with vi and I can cat it (you'...
1
vote
1
answer
3k
views
Bash getops: allow, but not require arg
I'm writing a bash script, parsing options with getopts like this:
#!/bin/bash
while getopts ab: ; do
case $opt in
a) AOPT=1
;;
b) BOPT=$OPTARG
...
1
vote
1
answer
370
views
Obtain Bacula status in parseable format
Is it possible to obtain the status of Bacula Director in some parseable format?
It looks like the human-readable representation (one you can see when using bacula-console) is formed on the director ...
144
votes
9
answers
494k
views
How to remove empty/blank lines from a file in Unix (including spaces)?
How do I remove empty/blank (including spaces only) lines in a file in Unix/Linux using the command line?
contents of file.txt
Line:Text
1:<blank>
2:AAA
3:<blank>
4:BBB
5:<blank>
6:...
2
votes
5
answers
577
views
Check availability of my websites
How can I check the availability of websites from hosted by company?
Ping the server and checking if the services for IIS or Apache/Tomcat
is not enough. I want to see if the sites are responsive, if ...
2
votes
2
answers
2k
views
Ways to parse NCSA combined based log files
I've done a bit of site: searching with Google on Server Fault, Super User and Stack Overflow. I also checked non site specific results and and didn't really see a question like this, so here goes...
...
2
votes
1
answer
2k
views
Potential issues with tab delimited Logformat for apache 2.2x?
My employer has a CustomLog piped handler that reduces and preps the static web content machine access logs into a format that is kosher for being dumped into hadoop/hive. Unfortunately it hinges on ...
2
votes
2
answers
2k
views
Parse/Edit Apache conf files with Ruby?
I need to write some scripts to make changes to Apache conf files, namely to add/update VirtualHosts. I plan on doing this in Ruby. before I write my own, are there any scripts/rubygems which allow ...
4
votes
1
answer
3k
views
Parsing iometer results
How do your visualise your iometer results?
8
votes
7
answers
26k
views
Get list of user-agents from nginx log
I have nginx log file, and I want to find out market share for each major version of browsers. I am not interested in minor versions and operating systems. I would like to get something like this:
...
0
votes
2
answers
595
views
Possible interface types that may show up in "ip addr show"?
Consider the output of a typical ip addr show on Linux:
# ip addr show
1: lo: <LOOPBACK,UP,10000> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127....
73
votes
12
answers
151k
views
Do you have any useful awk and grep scripts for parsing apache logs? [closed]
I can use log analyzers, but often I need to parse recent web logs to see what's happening at the moment.
I sometimes do things like to figure out top 10 ips that request a certain file
cat foo.log ...